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]


51

Variables:

PullbackBars(3), Percent(0.35), RangeLength(5), RangeFactor(0.7);

AcmePullback = o;

Conditioni = AcmeRetraceDown(PullbackBars) = True; Condition2 = AcmeTail(Percent. RangeLength) = l; Conditions = AcmeCobra(Percent, RangeFactor) = l;

If ADX(Length) >= ADXLimit and DHIPlus(Length) > DMIMinus(Length) and AcmeRangePercent(Close, RangeLength) <= Percent and (Conditioni or ConditionZ or Conditions) Then AcmePullback = l;

Conditioni = AcmeRetraceUp(PullbackBars) = True; Conditionz = AcmeTail(Percent, RangeLength) = 2; Conditions = AcmeCobra(Percent, RangeFactor) = 2;

If ADX(Length) >= ADXLimit and OMIMinus(Length) > DHIPlus(Length) and AcmeRangePercent(Close, RangeLength) >= (l - Percent) and (Conditioni or Condition2 or Conditions) Then AcmePullback = 2;

lerangepercent

AcmeRangePercent: Calculate the range percentage over n bars

Inputs:

Price(Numeric), Length(Numeric);

Variables:

RangeHigh(0.0), RangeLow(o.o);

AcmeRangePercent = 0.0; RangeHigh = Highest(High, Length); RangeLow = Lowest(Low, Length); If (RangeHigh - RangeLow) > 0 Then

AcmeRangePercent - (Pricr - R.ingelow) / (R.ingpHigh - K.ingrlow);

acmerangeratio

Funcdon

AcmeRangeRatio: Calculate the Range Ratio

Inputs:

Ungthl(Numeric), Length!(Numeric):

Variables:

Rangel(0.0), Range2(0.0);

AcmeRangeRatio = 0; Rangei = Average(Range, Lengthl); Range2 = Average(Range, Length2); If Rangei <> 0 and Range! <> 0 Then AcmeRangeRatio = Rangei / Range!;

acmerectangular

Inputs:

RectangleLength(Numeric), RangeLength(Numeric), RangeFactor(Numeric), RangeRatio(Numeric);

Variables: ATR(0.0), VLength(30), RectangleHigh(o.o), RectangleLow(O.O), RectangleHeight(0.0), RangeHigh(0.0), RangeLow(O.O), RangeHeight(o.o);

AcmeRectangular = False;

ATR = Average(Range, VLength);

Rectangle-High - Highrsl(H<gh, Reil.ingii-LfriiMi); ..... h.w.".l(lnw, kr< 1.1,1,;1 ;11);

Rr<l.iiii;lfln Rn I.Hi):ltll<-i;lil

1.1 ),.-) >1 K<4l.iii,ihi



RangeHigh = Highest(High, RangeLeng1:h)[RectangleLength]; RangeLow = Lowest(Low, RangeLength)[RectangleLength]; RangeHeight = RangeHigh - RangeLow;

If RectangleHelght > 0 and RangeHeight > 0 Then

If (RectangleHelght / RangeHeight) <= RangeRatio and RectangleHeight <= RangeFactor * ATR Then AcmeRectangular = True;

AcmeRetraceDown

Inputs:

Length(Nufneric);

Variables:

InsideDays(0), LowerBars(O);

AcmeRetraceDown = False;

InsideDays = CountIF(Low > Low[l] and High < High[l], Length); LowerBars = CountIF(Low < Low[l] and High < High[l], Length); If (LowerBars = Length or

(InsideDays = 1 and LowerBars = Length - l)) Then AcmeRetraceDown = True;

AcmeRetraceUp

AcmeRetraceUp: Search for an n-bar retracement upwards

Inputs:

Length(Numeric);

Variables:

InsideDays(0), HigherBars(o);

AcmeRetraceUp = False; 1nsi<H).iV4 Cr)unlll(l<» lhV.lK-ill.,1-. (.i4i.tll(li)w II (lli);li<-iH.ii-. hH):Mi I

lfiwl .iiid Hii;h < lli>.li)i. M-ncHi); l.iwhl .iiKl Ihyh lli)>.lii, h-iif.ltO,

11.4S:.iJioe iroie

(InsideDays = 1 and HigherBars = Length - l)) Then AcmeRetraceUp = True;

AcmeRangePercent(Close, l)) / 2;

Inputs:

Percent(Numeric), RangeLength(Numeric);

Variables: RP(O.O), RP2S(0.25), RP50(O.5O);

AcmeTail = 0;

RP = (AcmeRangePercent(Open, 1) Conditionl = RP >= (1 - Percent);

Condition2 = AcmeRaiePercent(Close, l) >= (l - RP25); If (Conditionl or Condition2) and AcmeRangePercent(Low, RangeLength) <= Percent and AcmeRangePercent(Open, l) > RP50 and AcmeRangePercent(Close, 1) > RP50 Then AcmeTail = l;

Conditionl = RP <= Percent;

Condition2 = AcmeRangePercent(Close, l) <= RP25; If (Conditionl or Condition2) and

AcmeRangePercent(High, RangeLength) >= (l - Percent) and AcmeRangePercent(Open, l) < RP50 and AcmeRangePercent(aose, 1) < RP50 Then AcmeTail = 2;

«4:4.»4*«**« 4,), * « « * * 4 • « 4-4-4* « 4< 4.«

AcmeTest: Search for a Fcsl Pattern

V.iii.iblr4:

l.llf..ll.(

••c-i.ii.il ii)uH.ii.(.•). ll.iN(o.b);



AcmeTest = ;

If Low < Lowest(Low, Length - and

NthLowestBar(2, Low, Length) >= SeparationBars and AcmeRangePercent(Close, l) > Half Then AcmeTest = l;

If High > Highest(High, Length - l)[l] and NthHighestBar(2, High, Length) >= SeparationBars and AcmeRangePercent(Close. 1) < Half Then AcmeTest = 2;

rripleBortoi

AcmeTripleBottom: Find a triple bottom formation

Inputs:

LDokbackBars(Numeric), 5trength(Numeric), RangeFactor(Numeric);

Variables: Delta(O.O), HighPivotl(O.O), LowPivotl(o.o), HighPivot2(o.o), LowPivot2(0.0);

AcmeTripleBottom -1;

Delta = RangeFactor * Volatllity(Lookbacl<Bars);

HighPivotl = PivotHighVSBar(l, High, Strength, Strength, LookbackBars); LowPivotl = PivotLowVSBar(l. Low, Strength, Strength, LookbackBars); HighPivot2 = PivotHighVSBar(2, High, Strength, Strength, LookbackBars); LowPivot! = PivotLowVSear(2, Low, Strength, Strength, LookbackBars);

If HighPivotl <> -1 and LowPivotl -1 and Kiivot2 -1 and LowPivot2 <> -1 and

AbsValue(Low - Low[LowPivotl]) <= Delta and AbsValue(Low - Low[LowPivot2]) <= Delta and AbsValue(Low - Lowest(Low. LowPivot2)) <= Delta and HighPivotl < LowPivotl and HighPivot2 < LowPivot2 and Low <= Low[ll Then

AcinrTiiplc-H.illiini hwlivi.l/;

rripleTop

Inputs:

Lookbac kBars(Numeric), Strength(Numeric), RangeFactor(Numeric);

Variables: Delta(0.0), HighPivoti(O.O), LowPivotl(o.o), HighPivot2(0.0), LowPivot2(0.0);

AcmeTripleTop = -i;

Delta = RangeFactor " Volatility(LookbackBars);

HighPivotl = PivotHighVSBar(i, High, Strength, Strength, LookbackBars); LowPivotl = PivotLo*JVSBar(l, Low, Strength, Strength, LookbackBars); HighPivot; = PlvotHigtiVSBar(2, High, Strength, Strength, LookbackBars); LowPivot2 PivotLowVSear{2, Low, Strerth, Strength, LookbackBars);

If HighPivotl <> -1 and LowPivotl -1 and HighPivot2 <> -1 and LowPivot2 <> -1 and

AbsValue High - High[HighPivotl]) <= Delta and AbsValue High - High[HighPivot2]) <= Delta and AbsValue High - Highest(High, HighPivot!)) <= Delta and HighPivotl > LowPivotl and HighPivot2 > LowPivot2 and High >= Highfll Then

AcmeTripleTop = HighPivot2;



[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]