20 11 Seurce Code ShortString = Shortstring + PatterrStrings
trú;
1 LengString oy “Then Begin Vales = fest henbate, fine, nh « Pricebelta, LoStrig); Hightort «test setabjiegalie, 2, 2;
TW ectuckcraundfolor = 1 The ‘est Setcalorvalve, Toot Yellow)
ast ‘ext SctCoor(Vaves, Tool Slack); 1 Alert or Stren(lengsteieg) >> 2 Then RhenkCiơg 2 + Legstriglr
keds
1 Shortstrieg ©“ Then Sepin Valuer = To hew(ste, Tey Low PriceDelta, ShorStrire)s 1 cettacereadtoler 3 Then “eet Setcolo(vaved, Tel Yello)
ase “tent SetColorValoe, Tel Black);
lostet > Text SetShlclikei, 2, 0; WP Alertnsbied or Strtn(Snorestring) >> 2 Then TH hen: 2 ShortStrieg)s trở fd ‘Acme Market Stategy Sates ‘Table U3, Acre Market Strtegy
‘Signa Name Long Entry | Longésat | Short Eotrs | Short Eat
‘Acme Market System |v v ‘Acie Trade Manager r r 114 Soteoe Cole ‘Acme Market System gai ‘cee Harket 5ystee: Lodk for cơrbinations cf nu]ttpTe market patter wm (vy
‘Rows Trdes, or TRIN (T) ull Bear Consensus (8) Short Sales Ratio (S)
vik PUtycaN Ratio New Highs New Lows
aN
Market Vane Bullish Consensus
Trang 2250 1 8ansesds = high « đơtayacter * A SketStp © En -(eneyroctor * AT 1 DataConpression < 2 Then ‘Comentary(This indicator must be applied to a daily bar ” + ‘interval er longer.”) se Begin Pattersstrieg =“ ing
AYR = Volatslity(Length); Prdecbelta = ATR / 45 If Close of Dataz > 0 Then Begin Potterrstrang ~ "V”;
hen - cong inded(Clee sự Dan, legt)y If Hightow > 3 Thêm tring ~ LongString + PatternString 7
Else TẾ Mgh su = 2 The, ‘Shortstring = Shortstring + Patternstring; End;
1 Close of ng 2, Ten Bein fottertring =P";
Highton = Achoight oulndex(Close of Osts3, Length): TẾ Nghe c1 Thơ tơ hi stigv Pttengting ise TY Highton + 2 Then Shortsiing’= shorttring + Patexestrings fed
1 Close Patterrstrang = “1”; of Datas > 0 Then Begin
Nhgh on - Acnehigh o.trdes(Close of Data4, Legfh); TẾ Rightow =? Ther letgsteing - Lengstring Potterstring
Else TF Righlow = 1 Then ‘ShortString = shortString + PattemString; : End;
1 Che of nas >The Bein
Nghe = oauhoante(cne (of vatas, Length); i hagitae = Long - long + ntenstrig
chee TẾ BghÌm = 2 De ‘ShoxtString - sertstring + PattemString; ú feds 1 Close of bata6 > 0 Then Begin Patteestring "7 ti te ot Matte, Sth), ae (A A Banas ts 26
If Highton = 4 Then LongString = Longstring + Patternstring se’ Highloe ‘ShortString = Shortstring + PatternStxing; = 2 Then
1 Close of Data > 0 Then Begin
CAN iirde(deee
one Jntrdex(Close of Datar, Length); a higitae <2 Then Lerastring + rattomStri: ey fase TF tags <a = Shortstring = Shorstrieg + Patternstrig;
tnd;
IF Close of bataB > O Then Begin HighLow = AcneiighLowindex(Close of Oat36, Length); Patternstring = °S"; TF Hightow «1 Then tegstring- Longstring + PatterString
ase tights hen ‘ShortString = ShortString + Pattemnstring; nd;
{calculate shares based on risk model)
N= AcneGetShares( Equity, RisWodel, RiskPexcent, RiskATR)s (ultiple Pattern Buy Signal
oe era oes Paes
2 cee, my, 09 aka 8
(ultiple Pattern Sell signal)
[If StrLen(ShortString) >= MininunPatterns Then Begin {Draw Entry Targets on the Chart) If Dravrangets Then
Trang 3262 AemeN Strategy ‘ae ‘Table 1.14, Acme N Seatexy 11 Sousve Code Seed Name Lore Erry | Long Est | Short Every | Short But Acme N System r Vv Acme Tide Manager 1 v ‘cme N System Sina! (resvevernososanencesssnnntenssssoeccegnunansnnastesenesn ten: se sae 1 PCR Parameters) ecco, euler), KH nung ob, {filler raseters) Fulterson(Tive), FiIterlergth(34), Hinimmerice(20), initmeA0X38), Minisuntv(0-5), (Position Paraneters} Equity (100000), iskrodel(3), ay stp (0.0) Ratio te fied Nene fae otters vu, 114 Source Cole 263 Shortstop(0.0), Aa = vedas (aitegth), fa merge (lose mere
{Set Entry ond Exit stops}
BuyStop = High + (Ertryfactor * ATR ‘ShortStop = Low ~ (EntzyFactor * ATR (hone W Setup
Condition.» Aeaearrntonge(Wengtht, 1) and
‘enekarrontange(uergty 0), Cateiont = ton > Tow{a} and High ¢ High{a] and Le{S] > o2] and
co SN larodtvgelMirgt2, Hos nena o ceding = feelciebg ens 0
Conditions = Acratangtato(kationgihi, RtioLengtha) <= Maehangetatio: Keno = Coors or Condit or Conditions os Condon or conte ions
{Run trade filters)
1 Filterson Then Trader =e > runice aed (Faltertergth) >= RininustOX apd ‘enaVolatality(FiiterLength) >= Kinsey; 1,
forge cc fargefercert * AE and TradeFiiter Then Begin
(calculate shares based on risk model}
N= AceeGetShares(Equity, Rishtodel, RiskPercent, RiskATR);
{arrow Ranged
TradeFilter = true; If Filters00 Then
Tradefilter = PedianPrice > MA; If TradeFilter ond
Senet acePown(RetraceBars) and Twa bi en en
Trang 4ai H1 ansssts fuy( “hone LE Wr) N shares Next Bar at PuyStop Stops TradefiIter = True; If Filterson Then "TeadeFilter = NedtanPrice < My TẾ TradeEllter and “Aenefetracelp(fetraccBars) and ‘TeadeFilter Then Begin {ơn truy, Tiệp on the Chart}
IF OrowTargets Then Conditions ~ AenentzyTargets("®", 0, 0, ShortStop, 0); S€I1CAcse SE N°) W Shares Next Bax at Shortstop Stop: end; nd ‘Acme NR — LỆ"9994EA439139Eeex9xkgtetsrtgkErrrtarttnsaotnnertettse eae MR: Display the narrowest range bar in, bars AMM: CESENDL te ctaarossstasamicesscannenansanevcc) ns: TNsegedo; TẾ koclarro.foogeargelentth, 0) Then Begin PlntraintarthĂVh Lạp Eácie My AlertC ke MT: fed Else begin hori a horton fs 28 Acme NRK —¬ nh 0686614044e011.0n0015010 l1140 ccgAmk.ee Bene NRX: Dist AE Inputs: Ty ưng), angeFactar(0.65); Variables: ‘ATR(O.0); IR = Volatility Eongetergt); Tf Range <= RangeFactor "ATR Then PIotraint to “ke Khen Cao ạt ket), tả Ee Ngon, heron); tr ferme NRO ‘itor L9 eteeetseereketrredderrosmdrorrerrrereerisoree Meets Olspay earn range bats in 200 eee ee Tuệ: Epeleth6); E eelarxsesrerExrgdlereth, 2) mở Amoasrlvos(fvpa gi C2 Thee Begin lotfainser ugh toe "hce Ma},
ler’ ("Rene N2 Aezt”) tne
Trang 5266 11 Seurce Code ‘AemePStrategy
rater
‘The Acme P System is a self-contained system with its own ext strategy, thus, does notuse the Acme Trade Manager
“Table HAS Acme P Statexy Sspnal Name | Long Bry | tong Et | Shor Bury | Short Eur | AsmPSem| rr | V “ “ ‘Acme P Systern Xem ‘ene P Syston: Pairs Trading Requizenents
Detaa: Stock 1 Intraday, (ated: Steck 1 Oatly @ tad: Stock 2 Daily (hidden) tame ot, Wace om E6 nhi Length(39), {Position Sizing Paraneters} Equity(1900000}, RfolelQ), RiskPercent(2.0), RRATRG.0), Ms sancs 2a Volatilityconstant(o.0523), Uppereand(o.0), Lowertand(0.0), Spread(0.0) HF Date © Datel} Then Begin Ni dentetSares(uity, Rsbodl, RiskPercert, RsKATR) of bata; Hi = Aenevolatility(Lergth) of ata3; Wi? = AenaVel2t1110/(Legth) oF Dataa; GW ~ correlation(Pricet, Price2, Length);
Veustilityeand = velatalstyconstant ¥ (4 + Hz) # (4 - CỤ; Uppertare = StandareDeviations * VolatilstyBand; LowerBerd = StandareDeviations * (-VolatilityBand),
fd:
Spread = (Close of Datat 7 Pricet) ~ (Close of Dataz / Price2);, TF Spread crosses above towertand Then Buy("Aone P LE") N Stores This Bar oo Close;
TF Spread crosses above 0 Then Battorg(“Aene P 1X +”) This Bar on Close
Ese TF Spread <= StordardDeviations * Lonerfand Then ‘Exituong( "Aone P LX =") This Bar on Close;
1 Spreng crosses below tpprtand Thee SUiCAGHe #3) Astros his far on Closes
1 Spread crosses below 0 Then Budtshort("Aone P SX +") This far on Close
Else If Spread >~ StardardOeviations * Exitstert(7Acme PSX =") This BaF on Then {tog Trades for Spreadsheet Export)
Trang 6268 11 Source Code done syste: Look For ‘h Paroneters} fectagltegin( a, leFactor(3.0), ectangletatio(®.3), {Filter Paraneters Filterson(Tive), FilterLength(18), MinisusAtE (2-0), {Position Parancters} Equity(s00000), Riskredel(3), RiskFercent(.0), iskATR(2.0) EntryFactor(0.25), Drowfargets(Tive); Variables: No), AIR(O.0), ‘rRLength(20), TẾ ha đe Buystop(0.0), Shortstep(0.0), (variables) ToRectangle(False), Rectangleligh(0.0), Rectarglelon(0.0);, [ATR = NolatilSty(/TRLength); ct ng dat «Lên Rectangle figh ~ Highest (High, Rectangletength); — + (xtafactor* AN5 E— - (erator * A;
If Falters0n then TradeFiTter = ATR >» MinkeumsTR; Af TradeFiIter Then Begin
( shaves h shade T, esktwacent, KASHAN: A woe M4 Samos Am {Dekernine vhether or rot we are in 2 rectangle} {Shectrge'sscntectanstin(tectangleergty Rctargfangs, nh TT nn Mesto
TẾ IHRectayle Then Begin {Orme Ely Torgets"on the chort}
Pate ee Cordier hoedntryTmgets(TV, BayStop 0, ea, sys fuy(heae LER) N Sates Nextar oh Bystop' {Oran entry Targets on the Curt} Sty
lim CConditiona = AcnefntryTargets(R", 0, 0, Shortstop, 0); Then “Sel1CBeme SE R°) W Shares Next Bax 69 ShortStop St nd; (rrteseravesasessanssoce wevevecsanunseteanneesonsoennnenentt
‘ee nite hey Me ath a
"ERs tower init),
Uppertinit (2.3);
Iota (Lovertinit, “Lover Linst"); Plota(Uppertinit, “Upper Linit”)
Trang 7210 1 Scarce Code rau: Recianglelength(), RangeLengthtt2), Rangefactor(l.0), Rangetatiolinit(3)5 ‘erectargleih(.0), Fectarglelon(@.0),” Uppertane(-1), toverLine(-1)} Rectangleligh = highest(tigh, Rectangle NA Ha nettle
IF nenetectangular(Rectangletongth, RangeLergth, RangeFactor,
ine Âu Re fetmglel=gt4]
Tìne|fectanglelength.1), te 7 exele), helo), ect ee
TF GetBackGroundColor = Black Then at 92 dpedte, elie) Tt Setcolor(Uppertine, Black); git SStetpetlne, 2; (ie nh pH th tung ng], Tie[Rectanglelength-1], Rectarglelow, Đate[o), Tire[o), RectangleLe); 1 LowerLine >= 6 Then Begin
If GetBackGrourdColor = Black Then ‘TL SetColor(LonerLine, Yellow) chế “TL Setcolor(LowesLine, Black); 1 setSize(Lowertine, 1); nd
Data2: Stock 2 Int Data: Stock 1 Daily ¢ Dates: Stack 2 Daily (hidden) gg g1NNH Pricea(Close of Dat3), Fricea(Close of Dataa), Staraardeviations(2.3, length(30); Variabies: wae, has), St ToseesGo), 0.0), RDHU em oan), tt Urata ‘Spread(o.0); If Date co Date[1] Then Begin Wit = Acneolatility(Lergth) of Datag; 2 = AcneVolatility(Lergth) of Data4;
GW - correlation(Pricet, Price2, Length); Vàsgl1itytmd — VelatTHiceeiam (tin + 2) * (1 ~ Cs Uppertand = Stardardeviatlone * VoTati12tyBand> cegltettod = Stanoraneiation * CAnlalllybr)y
st (ef mi) (res ea
Plota(o, *2ero")
Trang 8on 11 Source Code Syste"), {hesition taragenent Paraeters) Exieractor(0.25), Stepbars(t), Tà treo, Profitrector(0-3), Hateors(s), Drowtargets(teve), ade đo tEne 6m ba) Variables: 'ATR(0.0), ‘aTRLength(20), ‘aTRFactor(0.0), PreFitBars(0), 5eHStrp(0.0), SelTargeta(0-0), ‘ell Target2(0.0), Coverstop(0.0 ATE = Volatility(ATRLength);
‘AlRFactor = ProfitFactor * ATR; ProfitBars = IntPortion(Holdats/2) © 1;
Setisop< Last (lon, Stpfors) = (etactr * AIR; BxdtLong(“Aene Li") Hert step Stop; 1 ProfatTarget Then Begin Sellargeta = High, + ATRFactor;
ExdtLong "Acne Lis") CurrentContracts/2 Shares Next ar at SellTargeta Limit; SelITarget2 = HighlProfitBars) + (2 * ATEfactor);
ExitLongc Acne Lies") ConrentContracts/2 Shares Next Bạt at Sellfarget2 Linit},
End
Tf BarsSincetntey >= HoldBars — 1 then ritheng("Aeer 130) Meal Bar on Open,
le Sup) «(UAL anton * ANE):
114 Seusce Code
Exitshort ("ne 54") Next Bar at Coverstep ‘If ProfitTarget T tan lun: Stops
overTrgett = Low ATRFctars Elsner ene 9£”) CurentCotzacts/2 Shares het Ba at overargst Ui Guerlangeta ~ Loe Profittars] ~ (2 + arRfactor)s Eclshort(Aene S02) Carentcnktacts/2 Shares Next Ba at If BarsSincetntry > HaldBars - 1 Then ExitShort “Acne Sx") Next Bar on Open; WfBStanr=or Tf DrawTargets Then ome ee, Sa ay 2 epee acy
inp eetgBpteem tre
{Log Trades for Spresdeheet Deort)
Trang 9Naas,
‘Si, «'suinghighBax(N, gh, Strength, Lergth)s Tf Sia © = Then Begin Nai
FoundtighPlvet = False;
Nile FeundhighPivot ~ False ard N ce RadzueFivots Begin Sega Hh, street, Leet); Hf sia oot and high{ St) Haigh SHE sghPivot ~ THe;
“SsdngLexBar(, Low, Strength, Length); If sla ot Then Begin wey
FoundlevPivot = False;
ie ouahoivat = alse ad Wc Minas pin SL2 = SeinglonBan(W, Lov, Strength, Length); HF siz ea ond Loos} > Lenfst2] Then FoundLowivot = T2ue} neweay end End 1 rent and Forno Th en Mi ~ TLSlopetany (gh, Sa, St); TC TP = 1Slopetasy Clow Sử, 3405, Projectiigh = TUaotasy (gh, SH, S42, 0); Frojecttos 1WolctasyCiow 3, 3, Aaaluihslre) Pavia hàn ton = Pest Then Bexar De nh Hoxinalope ard
từ - TU enOate( ta], Timea], Highs}, Date, "tine, iets
Tem hếc@ebelSU), tine( Sta], ent, tate, nes end ted a 114 Sun TRO), Towa) sne(-25, lextstrdng(°")5 Ate Volatihity(Lockbocktars);
TS rildettntledlideae, sươh, tryưa<e0; TF Ter oo then tee Date obsr), Tame ota, km Hef), tow,
Alerstry 1 traPunfsibckaus) > Mine (Lostbackas) Ten «shen Tape Sti” Cates = Asalin(Ln = verge(lose, engl) <
RangeFactor * ATR = »)
the TẾ BA hs(lolbadesrs) minh ÄưoiietHgi ` maogefie, MnyA) = D80 LostbacBars) Ten Fengetactor
1 Conder men AienGtre = Mertstring ô â ke ô
Nntste(SLength, â) + tar Moving Averages
Trang 10276 11 Source Code RengeFactor(0.), TA gtkƠO); Variables: hy
‘iar Aemriletr(Lrlbxlêns, Stength, Rangefater; If Trear © -1 Then begi True Th Menatel OL, ale eh,
Date[TTBax), Tane( TBar}, High);
‘lortString’> “Bene Triple Toy"; If DeTPlus(LookbsckBars) > DlMinus(LookbockBars) Then, (Conditions = AbsValue(tow = Avexage(CTese, MALergt!)) <= RangeFactor * ATR Else TF DMTPlus(LockhackBars) < DAIMinus(LookbackBars) Then Coreitiona = Absvalve(High ~ Average(Close, MiLength)) <
actor * ATR;
“TẾ Cenlrtierl Then lertString = AlertString + “ Near "+
ustostr(WaLength, 0) + Bar Moving Average”; If Alertérabled oF Condition: Then ‘Alert(Alertstring); Ena; ‘Acme V High Zone, —¬ TY nh 2mm: TH the te v hgh Zone fi l ss _ LatilityFactor(0.9), Length(20); variables: ‘ghzone(0.0);
spire = tea velataityractr, enh) We thighzore > 0.0 and Wigh >= Wighzore Then ft lơ S Mạ đe); Hee ‘Acme V Low Zone Tan pm Aene V XỔ nhhy«etes, “Thu =mee Variables: ‘VLowzone(0.0);
owone = heneMLow(Volatilityfactor, Length) TF Veawone > 0.0 and Low <= VLowZone Then
Trang 11208 11 Source Code Entyfacton(0.25), ng ATR = Nolzti1ty(ATRLengt), Wt ~ tverage(Close, Balength) Livalue = Linearkegvaloe(ton, Regressionfars, -1); {entry Signal)
IF (DayOfWeck(Date) = 1 or DayOFWeck(Oate) = 2) Then Begin {Calewate shares based on risk model}
Ws BenetetShares(Equity, Risttodel, RiskPercent, RISKATR)s If High < Lovest(high, Regressionfars - ){1) and
Range-<= RangeFactor * ATR and ow > LRAalue and
se Md
High > Lost} Then Begin {Draw Entry Targets on the chart}
IF Drawtargets then (Condition = AereEntryTargets(*V”, Close + Entryfactor, os, Of tute V) Nha Net B Cha + Ergon Steps en wet Asia nem LH tho nniveeettim b1 Tan: "Percent here) Range ators); 1.4 8anaS 2:9 ATR = Wolatility(Length)s
Af AcmetangePercent (Open, 0) <= Percent and enetargePercent (Close, 0) >= (1 - Percent) and Range <= RangeFactor * ATR Then Menecebra= 15
If AeneRangePercent(Open, 0) >= (4 - Percent) ard ‘cnefangePercent (Close, 0) <= Percent and Range <= RangeFactor * ATR Then ‘Renecobra = 25 Variables: Rangedelta(0.0), Hightvot(0.0), Leivek(0.0), ¬ <1; TH “hi veìrthity(laddxd8er); LoxPivot = PivetLowsBar(1, Lou, Strength, Strength, LookbockBars); vot = Pivothigh’SBar(2, Wigh, Strength, Strength, Lookbackbars); If HighPivot © -1 and ket <> 4 and
LowPivet sẽ Ledfinlus and
‘Absvalue(Low — toe{LowPivet)) <= RangeDelta and
‘Aosvalue(Lon - Lonest(Lony LowPivet)) <= Rangedelt2 and HighPivot < LeyPivot and
Trang 12280 11 Source Code ¬ itt ue, tr vie), neo tweeioy Voriables: Ha(o.0), Highrivot(o.0), LowPivot(0.0), Mghfunieut();
Aungetelta Rergeolts c Wigetoct = plactighisbarcs, igh, Sere, Steength, Lokbadbars): targefctor* Vol:4Đty(ledbadBar9) imgdacte * ); Ueleswct ~ vottodStory tow Strength Strength LookbockBors);
wget 0 -1 ant NT Ngee 5 hg
Side Shahup Sit) ce Ranges nd
Aimalriigh Hơm, Hạn tnỦ) c Rael wd mig 9 teh ence Higa; men ‘AcmetneryTargets "never {theeesenvessenssnnnsccsaneecesstannercecentsssenannancccennee sede rice rete nee Inputs: ‘SystentD(string), BuyStop(tuneric), fuyLinit@iuneric), ‘Shartstop(Muneric), ‘ShortLintt uneric}; variables: PlotCelor(8lxck), SLine(-1), tá Ban BLrext(-2), ssText(-1), strext(-a)}
encenteyTagets « False; 1 LastBarnchart Then Begin TP ceteackecunteohor 4 Then iotector = write;
1 ByStnp > © Then Begin Bebtring Lee syetent) + * stop *s ire = TLNew(ate(O], Tinto], BiyStop, Date(s), hae), Bystop)s
TF ie 90 6 then bepin Setcolor(Rt ines PlotColo); Te setsize(@stin, 3); RSL ein sTent = Text hen(bte, Tine; fuyStop,OSstring); ‘ent seiclar(estent,Plotcolor)y thác TF buytindt > 0 Then
BiStzing = IE â Syetent ô BlLine © T_new(atelO}, TR«[o], hit, «Lint; Datefa), Tae}, ByLanit);
TẾ BH le 3> 0 Tien Begin TL Set ler@ILe, Plotrelor);
TỊ SetStze(ELLine, 2) BSH re th se sci) BLiext = Tent Nen(Dte, Tse, Bọtiett, UString); “ert Setslor(M Tod, Plotcolr)y
Em
1F Shortstop > 0 Then Begin Ssstring = * SE's ystentD + * Stop "ý SSLine'= TL New(0atel0), Tiel0), Shortstop, Date[ap, Hse), shortstop)
TO SsLine >= 0 Then Be Te setcalor(SsLine,
Te Setsze(sstine, 1) TE Setothight (Sine, True);
fet = Tert Men(Date, Tine; Shortstop, SSString)s ‘Tent Setcalar(Sstext, Plotcolor); nt Color) en
Tf ShortLinit > 0 Then Begin Sistring « " SE." » SystenID + * tintt "; ‘SLLire = TL Ney(Date(6], Tinefo], shortLiett, Date(s], TÍAe[3], shortLieit);, If SlLine >= 0 Then Begin
Trang 13282 11 Source Code ‘ext Settolor(stText, PlotColox); ng End; End enetntyTargets = True ‘AcmebsicTargets —— L(*Q99+kot199500serhvAAArrtefetfrrt9tr111411210000040906 c0 TH HE ut te op ots od eo re eau, ts: cgD(strdre, Septastnner), nh gi, Potitargethneri), Variables: PlotColor(tilack), SLLine(-1), PTaLine(-2}, PraLine(a) sistring(*", stext(“3), Pristring™"), PTiToxt( 9), prastring("), Pratext(-3)s AeactxitTangets ~ False; If LastBaronchart Then Begin Tf HarketPosition = 3 Then Begin SUstring = "LX" + SystenlD + *:") Prastring = "DC" System » “4h Prastring = "UC" $ SystenD + "44 ind Tf forketPosition = -1 Then Begin ‘string =" SK" + SystealD 4 PHString - * SX "+ SystenID + “+ rastring =" SK” $ SystemID + "42"; Ends Flottolar = white;
SLLine - TL Nes(bate(o], Tine(Ol, Stoploss,
Datel] Tine[ TẾ Niệm a Stl T4 Bảm an
TL setstze(sttine, 2); TCSeteathight(SULing, Tze);
SlToxt = Text Ne(Oate, Tine, StopLess, SIStri
pelt Stinson hetcon)
PTatine = TLNew(Datefo], Tinefo), ProFitTarget1,
Da, that), Providfaneety TF Platine vs 0 Íne BagÌn = TL SetColox(PiLine, PlotCélor); TL Setsize(PTatine, 2);
Tsetortnighe(rratine, Tre);
Tiệc = Text Nen(atey Tine, ProfitTorgts, PTAString);
‘ent Setolar(Ptitet, Ploteaor); a
Bạc
TP me < t kedDatk[d], neo), ref3targeD, Ciel), Tiel Protos), TL TL SAloxtPDtiree Pldole); mg lạ beste
TW setsie(ratine, 25 Tsetse (Piling Tue);
Trang 1428 11 Sousve Code —¬ rchntcongelte, ety the value of the oer flat hoa Teputs: TheFhoat(lomeric); Variables: Tlost8ars(6); .AcneFlộtChamelLow = Flostbars ~ 0;
TẾ heflest >'0 Then Sepin Flostbae - pncet lonttars(tesleat)s
If FleatBars >'0 Then ‘RereFloatChannelliog ~ Lovest(Lov, FloatBars); AcmeGetFloat ——
“This listing contains only a patial ist of float values Refer to Chapter 4 for ob- taining and adding afloat value to the AemeGetFloat function Kqeecetriogt, cot te ost cfs given sto bo sen); variables: 114 Source Cole 285
‘Symbols[ ix] = "ABC"; Fleats[dx] = 01.75 ix Sybols[ix) = “ABP”; Floats[ix] = 37.05 ‘Syabols[ix] = °ABFS*; Floats( ix] = 15.45 3x ĐA li < 28a oat ta = Gr be Sbels[Dx] = “ABE”; Fleats[b
‘Syabels[ix] = “AM Fleats[b
Soi] = “ABW Fleststbe = Tại SInbols{Sx) ~ “8u; EIos Dị - 2e; Symbols Sa] = “71CM; Elotsl ‘Synbolsfix] - "0472 Flosts[ix] = 28.8; Syabolsfix] = “Z8; rleats[b] = ta Syrbolsfix) = *ZRMP; Flosts[ix] = 9 ound = False; = 95 i= ee
While SynbolFound = False and (iu - (1) > 2 Begin in = IntPortion( 2 Sybet © Sabi (il + tu) / 2); Ther
Trang 152 Manse Oe If Fleatvalue > 0.0 Then Begin idle TotalVoline ¢ Floatvalue ang Bartrdex < MaxBarsBack Begin ‘AcneGetFloatBars = BarIndex; AemeGershares — (reteoseveersesseeerkeossrretstrgeerm Hy
ReneGetShares: Calculate the runber of stares based on risk model Rislobodel = 1, Equal Valve Units Hodel
Siigedel = 2, Percent Wik Poel Risbrodel = Tấn: qityweric), i05 (uad1), Einmeeettimeri9), Histintsqumeric Variables: ‘Minieurshares(200), iskshares(0), FE(0.0), Length(20);
ERP = Equity * RiskFercent / 3005 If Ristodel RiskShares ~ RouList(HirimaShares, = 1 and Close > 0 Then 400 * IntFortion(Equity / (300 * Ciose))); TẾ Rietfodel = 3 and Riskunits > 0 Then RiskStares = NanList WirinoShares, 1100 * IntPortion(ERP J (300? EislOnlt9))); Hf Rishtodel = 3 and Volatility(Length) > 0 Then Riskshares = WavList Qininashares, 200 * IntPortion(ERP / (400 * Volatility(Length))))s eneGetShares = RiskShares; T4 3n: RPLieit(6.45), RLinit(0.60), Marani1(Talse), Warani2(False), Horani3(False); Ancram = 0; 1 fang} > © and Rare] > © nd fae], > © Then Begin (eaten © tov se eal nd gh Faas Gratton = Ge >
CÁ ng ~ vơ erlet(Ge, ĐH] c UUit sở
TH ae 3 (1- RPLiit); Farah Cnt and Solio a bition and Se ae eel © atin cates
Conditions = Lon > Lon] and igh M2 CN = Leta > angio Heh nen ca, CN ~ xe-tvpdiorer(Clee, 2B] c tt xá no ants It Coit ond aia ed Cette ed No ines,
enditiora = Li = Lon} ae wih we
nitions = Lana] So Leu 3] antiga High];
Grieg = La > en} ad A) HA
Conditions = Close
ơi = SerctargePereert(Cose,1){3) cRPLinit and
Aenaaretrcrt Gey, Hit:
‘conditions = (Range /'Rangel3]) <= ReLinit;
rar = Condition and Condition2 and Conditions and Conditions and Conditions ard Conditions;
TẾ Haramil or Harani2 or Haramni3 Then ———
Conditions = Low > Lowfat} ard High < High|n]; Condition? = Clone < Opens
Gratin = Resetarys DE Gm iat), et (Open, LAY «a Ut
Trang 1611 bance te aranis = Conditions and Condition? ard Cooditions and Conditions; conditions» tow > tn{2] sn High anemone rT: A Cảng cm cự CN ng - Andtvprtctert(ten, 2)D] « it mở fenctngcbercet (cose, Aa] (init: Ecnaitirs = (eng / Em) c Hs
Vtanta” canta nd Cnet an Efiien) an Cơn mở Gảidony
ontstions = tw > Lona] an High «Heh Hoa © Lm] > lu) and haga Hah endatzra~ Lua] >> tea] are HG] <= MNS Am = Close open
Ending = Rncargeerest(pen, 2(3} <= PL and Tan nu 7 ỌÌ c HH ania = cnelrs od Endo an Conder and cree / tages)
Cengithnt ar Canes ard Caner
“TẾ Haraaf1 or Harani2 or Harani3 Then Aenetaraml = 3; Em; Ae winder: enehightowindex: Calculate the High Low Index Ắ<=” Inputs: Price(Nurerl), Length(Nueric); ®enetighLontrder = 0; mm L1): 70N Mu 7 fa ef mst ric, teen — 2} Price > ecghesinde 2; 7 Search for a Hook Pattern ripe: s(uneric), th (Ai; Acrelbdk = 0; 1E AcechetraceIp(tength)[1] anử
Low < Lowf} and (Chose, 3) >= (4 - Percent) ‘hencook = 3, Then
Xf Acetraceso( erga] and
Trang 17
20 risa:
rf < Lomest(Range, Ra sth - 1) (Index + 1] and
tea at] mổ ghee ‘inet Te ene = AametogTrades Tam m=—= EEUENESI Da thu THỊ SE T62 EBOEEE, 3 teID(String); Variables: waren), Tradestzing("); kerelegTrades = False;
1 Leggingon and Category {leg Closed Positions} = 2 Then Begin Hf Barssincebxit(2) = 2 Then Begin TradeString = GetsyebolNone # ")" + eaters) ) +“, hustestx(EntryPrice(3},-3) + 2,” + unTestr(Exitbate(s), 6) + *7+ MaTestz(PvitfrleeQj, 3) t2 MaTestr(fes{tiefSofit(1), 3j + 0y” + aes tet), Ot ontests(VelatslstyCLength)foarssincetrtry(a)], 2)" *," + Mest (aenevolaetTity(Length)farssincetitry(s)], 3) + ‘ny systenlD + Red (ogrileiane, Tradestring); te Bosker
WEetrontaet and casetireseg > © Tho en eg ceo > teat (intrytate(a) 0)» Retest 066 fens 3)s NuTostr(OpentesitionProfit, 3) + ",” 3uafestr(Abx(ADMcngtt)|0arasircctrẺ ry() "MeTestr(\elat41iĐyfIergt)|Sar-Si (oN 2)"+ {Vevgth)tarssietateyo D's ‘AcmeNarrowRange ——
Đơn To species tar 3 arrow tnge hart, vabennovSsssasqnrcasbescunasesasonenetsocasemesaseseatetereesss)