back start next
[start] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [ 46 ] [47] [48] [49] [50] [51] [52] [53] [54]
46 AcmeN Strategy Table 11.14. Acme N Strateg>- Signal Name | Lm | Long Exit | Short | lort Exit | Acme N System | | | | | Acme Trade Manager | | | | |
acme N system Signal Acme n system: use the range ratio to find narrow range patterns inputs: (n parameters} ratiolengthl(l). ratioleneth2(7), rangepercert(0.7), hakrangeratio(0.7), retracebars(2), (filter parameters) filterson(Triie), filterlen6th{l4), minimumprice(20), minimumadx(38), hinimumhv{0.5), (position parameters} equity(100000), riskmodel(3), riskpercent(2.0), riskatr(l.o), entryfactor(0.10), drawtargets(true); variables: n(o). atr(o.o), atrlength(20). ha(o.o), halcngth(50). t,.uh-i illrr(lm.-). shortstofko.o), (n variables) nlengthks), nlength2(l0). nlength3(4), lowvolatility(false); atr = volatility(atrlength); ha = average(close, halength); (set entry and exit stops} buystop = high + (entryfactor * atr); shortstop = low - (entryfactor * atr); (acme n setup} conditionl = acmenarrowrange(nlengthl, l) and acmenarrowrange{nlengthl, o)[l]; condition2 = low > low[i] and high < high[l] and low[l] > idw[2] and high[l] < high[2]; conditions = acmenarrowrange{nlength2, 0); condition4 = acmeinsidedaynr(nlength3, 0); conditions = acmerangeratio(ratiolengthl, ratiolength2) <= haxrangeratio; lowvolatility = conditionl or condition2 or conditions or condition4 or conditions; {run trade filters} if filterson then tradefilter = close > hinimurnprice and adx(filterlength) >= minimumadx and acmevolatility(filterlength) >= 11 ¹; if lowvolatility and range <= rangepercent • atr and tradefilter then begin (calculate shares based on risk model} n = acmegetshares(equity, riskmodel. riskpercent, riskatr); {harrow range} tradefilter = true; if filterson then tradefilter = hedianprice > ha; if tiadefiller jnd acncrftracroown(retrac(£ar<.) jnd tr.idefillcr thrn rrgln (dr.iw hitiy 1.> >>- nil ihi- (ImiI i 11 lir.twl )>.1-1-. ilini < niiilil lopil 11 1 1.1)-;-1-.(" ". liiiymiii, n, u,
LE N") N Shares Next Bar at BuyStop Stop; End; TradeFilter = True; If FiltersOn Then TradeFilter = MediarPrice < HA; If TradeFilter ard AcmeRetraceUpCRetraceBars) and TradeFilter Then Begin {Draw Entry Targets on the Chart) If DrawTargets Then Conditioni = AcmeEntryTargetsCN", 0. 0, ShortStop, 0); SellCAcme SE N") N Shares Next Bar at Shortstop Stop; End; End; NR: Display the narrowest range bar in n bars Inputs: RangeLength(lO); If AcmeNarrowRangeCRangeLength, 0) Then I PlotPaintBar(High, Low, "Acme NR"); AlertCAcme NR Alert"); Else Begin NoPlot(l); NoPlot(2); End; Jt of ATR Inputs: RangeLength(lo), RangeFactor(0.6s); Variables: ATR(O.O); ATR = Volatility(RangeLength); If Range RangeFactor * ATR Then Begin PlotPaintear(High, Low. "Acme NR%"); AlertCAcme NR% Alert"); Else Begin NoPlot(l); NoPlot(2); End; Acme NR2: Display 2 narrow range bars in a row Inputs: RangeLength(5); If AcmeNarrowRange(RangeLength, l) and AaneNarrowRange(RangeLength, o)[l} Then Begin PlotPaintBar(High, Low, "Acme NR2"); Alert("Aane NR2 Alert"); Else Begin NoPlot(l); NoPlot(2); End;
AcmePStrategy The Acme P System is a self-contained system with its own exit strategy, thus, it does not use the Acme Trade Manager. Table 11.15. Acme P Strategy :h(ilName | Lceig Entry | Long Exit | 81 1 Entry | 81 1 | AcmeP Syisteni | | | | |
Acme P Syscetn S/gna/ ftcme P System: Pairs Trading Requlreiients Datai:Stock l Intraday DataZ: Stock 2 Intraday Data3: Stock 1 Daily (hidden) Data4: Stock 2 Daily (hidden) Inputs: Pricel(Close of Data3), Price2(Close of Data4), StandardDeviations(l.5), Length(30), {Position Sizing Parameters) Equity(100000}, Ri5kModel(3), RiskPercent(2.o), Ri5kATR(l.o). {Trade Logging} logTrades{False), logFileCDrders.txt"); Variables: N(O), HVl(O.O), HV2(n.O), 1 V(ll.i)). Viil.iiililyli.....I(it.ti), VolatilityConstant(o.0523), UpperBand(O.O), LowerBand(o.o), Spread(o.O); If Date <:> Date[l] Then Begin N = AcmeCetShares(Equity, RiskModel, RiskPercent, RiskATR) of Data3; HVl = AcmeVolatility(Length) of Data3; HVZ = AcmeVolatility(Length) of Data4; CV = Colielation(Pricel, Price2, Length); VolatilityBand = VolatUityConstant * (HVl + HVZ) ♦ (1 - CV); UpperBand = StandardDeviations * VolatilityBand; LowerBand = StandardDeviations * (-VolatilityBand); End; Spread = (Close of Datai / Pricel) - (Close of Data2 / Price2); If Spread crosses above LowerBand Then BuyCAcme P LE") N Shares This Bar on Close; If Spread crosses above 0 Then ExitLongCAcme P LX +") This Bar on Close Else If Spread StandardDeviations * LowerBand Then ExitlongCAcme P LX This Bar on Close; If Spread crosses below UpperBand Then SeUCAcme P SE") U Shares This Bar on Close; If Spread crosses below Then ExitShortCAcme P SX +") This Bar on Close Else If Spread >= StandardDeviations * UpperBand Then ExitShortCAcme P SX -") This Bar on Close; {Log Trades for Spreadsheet Export} Conditionl = AcmeLogTrades(LogTrades, LogFile, "P"); .e.. i[[eRStLat-Ejgy 11.16. Acme R Stiategy SigiiNcuHe | | LorE-at | Emrv | Short Est | Acme R System | | | | | Acme Trade Manager | | | | |
[start] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [ 46 ] [47] [48] [49] [50] [51] [52] [53] [54]
|