Amibroker AFL Scanner Candlestick Pattern Indicator

Amibroker AFL Scanner Candlestick Pattern Indicator

CANDLESTICK PATTERN INDICATORS FOR AMIBROKER AFL

After testing many candlestick pattern indicators and having hands on experience with Amibroker AFL Code, we trailblazers, at Trading fuel got Indicators that were ranked by their ability to identify strong reversal patterns.

Amibroker AFL Software for Technical Analysis

The Pattern identification Master indicator helps to Identified 10 popular candlestick patterns i.e. 5 of bullish and 5 of bearish patterns.

Each individual candlestick pattern can be turned on or off. The special alerts for each individual pattern can also be turned on or off. The pattern also can be set in a separate color for each different pattern.

Only this indicator will allow you to assign separate color to each candlestick pattern. This indicator uses different abbreviated labels which keeps the chart less cluttered and include onscreen legend to identify each pattern that is highlighted.

This indicator will not be able to identify morning or evening star patterns for some reason. Also it seems to think with long wick that is a shooting star or hammer and regardless of how the large real body is.

It also doesnt identify the hanging or inverted hammer candle. The Candlestick patterns are ineffective if they are not traded within the proper circumstance of the market.

The next candlestick pattern indicator for Amibroker is slightly better in terms of recognizing patterns even though it falls short in every other aspect.

The candle patterns indicator was designed to identify 30 different popular candlestick patterns. But unfortunately one cannot turn each individual candlestick pattern on or off. One can chose from strong reversals, continuations, unclassified and weak reversals patterns.

The Morning and Evening star patterns are identified by this candlestick pattern indicator, which is an improvement over the previous indicator. It can identify hanging and inverted hammer patterns more accurately.

This is the best indicator that we can recommend for recognizing candlestick patterns. We believe this is the best indicator for selecting patterns in Amibroker AFL.

Steve Nison is THE power on candlesticks. He is legally responsible for introducing Japanese candlestick trading to the Western world.

The Nison Candle Highlighter is designed in order to identify 28 candlestick patterns. They are according to Steve own specifications and know that the patterns are accurate. The highlighter has that ability to turn the individual candlestick pattern on or off. So, you should focus on the patterns that you are interested in trading.

The Nison Candle Highlighter improves accuracy in identifying candlestick patterns within the proper situation of the stock market. To conclude thats the reason we the experts at trading fuel believes it is easily best candlestick pattern indicator for Amibroker AFL.

SetChartOptions(0,chartShowArrowschartShowDates);

smallBody=(O=C*(1-smallBodyMaximum) AND whiteBody) OR (C=O*(1-smallBodyMaximum) AND blackBody);

largeBody=(C=O*(1+largeBodyMinimum) AND whiteBody) OR C=O*(1-largeBodyMinimum) AND blackBody;

identicalBodies=abs(abs(Ref(O,-1)-Ref(C,-1))-abs(O-C)) abs(O-C)*smallBodyMaximum;

smallUpperShadow=(whiteBody AND H=C*(1+smallBodyMaximum)) OR (blackBody AND H=O*(1+smallBodyMaximum));

smallLowerShadow=(whiteBody AND L=O*(1-smallBodyMaximum)) OR (blackBody AND L=C*(1-smallBodyMaximum));

largeUpperShadow=(whiteBody AND H=C*(1+largeBodyMinimum)) OR (blackBody AND H=O*(1+largeBodyMinimum));

largeLowerShadow=(whiteBody AND L=O*(1-largeBodyMinimum)) OR (blackBody AND L=C*(1-largeBodyMinimum));

upGap= IIf(Ref(blackBody,-1)AND whiteBody AND ORef(O,-1),1,

IIf(Ref(blackbody,-1) AND blackBody AND CRef(O,-1),1,

IIf(Ref(whiteBody,-1) AND whiteBody AND ORef(C,-1),1,

IIf(Ref(whiteBody,-1) AND blackBody AND CRef(C,-1),1,0))));

downGap=IIf(Ref(blackBody,-1)AND whiteBody AND CRef(C,-1),1,

IIf(Ref(blackbody,-1) AND blackBody AND ORef(C,-1),1,

IIf(Ref(whiteBody,-1) AND whiteBody AND CRef(O,-1),1,

IIf(Ref(whiteBody,-1) AND blackBody AND ORef(O,-1),1,0))));

Today is the maximum High in the last 5 days*/

Yesterday is the maximum High in the last 5 days*/

Yesterday is the minimum Low in the last 5 days*/

DT = abs(C-O) = (C*smallBodyMaximum) OR (abs(O-C)=((H-L)*0.1));

DY = abs(Ref ( C, -1)-Ref(O,-1)) = Ref ( C, -1) *smallBodyMaximum OR abs (Ref ( O, -1)-Ref(C,-1)) = (Ref ( H, -1 ) Ref ( L, -1 ) )*0.1;

LongBlackCandle = (OC AND (O-C)/(0.001+H-L)0.6);

SmallBlackCandle = ((OC) AND ((H-L)(3*(O-C))));

LongWhiteCandle = ((CO) AND ((C-O)/(0.001+H-L)0.6));

SmallWhiteCandle = ((CO) AND ((H-L)(3*(C-O))));

HangingMan = (((H-L)4*(O-C)) AND ((C-L)/(0.001+H-L)= 0.75) AND ((O-L)/(0.001+H-L)= 0.75));

Hammer = (((H-L)3*(O-C)) AND ((C-L)/(0.001+H-L)0.6) AND ((O-L)/(0.001+H-L)0.6));

InvertedHammer = (((H-L)3*(O-C)) AND ((H-C)/(0.001+H-L)0.6) AND ((H-O)/(0.001+H-L)0.6));

ShootingStar = (((H-L)4*(O-C)) AND ((H-C)/(0.001+H-L)= 0.75) AND ((H-O)/(0.001+H-L)= 0.75));

BlackSpinningTop = ((OC) AND ((H-L)(3*(O-C))) AND (((H-O)/(0.001+H-L))0.4) AND (((C-L)/(0.001+H-L))0.4));

WhiteSpinningTop = ((CO) AND ((H-L)(3*(C-O))) AND (((H-C)/(0.001+H-L))0.4) AND (((O-L)/(0.001+H-L))0.4));

BearishAbandonedBaby = ((C1 == O1) AND (C2O2) AND (OC) AND (L1H2) AND (L1H));

BearishEveningDojiStar = ((C2O2) AND ((C2-O2)/(0.001+H2-L2)0.6) AND (C2O1) AND (C1O1) AND ((H1-L1)(3*(C1-O1))) AND (OC) AND (OO1));

DarkCloudCover = (C1O1 AND ((C1+O1)/2)C AND OC AND OC1 AND CO1 AND (O-C)/(0.001+(H-L)0.6));

BearishEngulfing = ((C1O1) AND (OC) AND (O= C1) AND (O1= C) AND ((O-C)(C1-O1)));

ThreeOutsideDownPattern = ((C2O2) AND (O1C1) AND (O1= C2) AND (O2= C1) AND ((O1-C1)(C2-O2)) AND (OC) AND (CC1));

BullishAbandonedBaby = ((C1 == O1) AND (O2C2) AND (CO) AND (L2H1) AND (LH1));

BullishMorningDojiStar = ((O2C2) AND ((O2-C2)/(0.001+H2-L2)0.6) AND (C2O1) AND (O1C1) AND ((H1-L1)(3*(C1-O1))) AND (CO) AND (OO1));

BullishEngulfing = ((O1C1) AND (CO) AND (C= O1) AND (C1= O) AND ((C-O)(O1-C1)));

ThreeOutsideUpPattern = ((O2C2) AND (C1O1) AND (C1= O2) AND (C2= O1) AND ((C1-O1)(O2-C2)) AND (CO) AND (CC1));

BullishHarami = ((O1C1) AND (CO) AND (C= O1) AND (C1= O) AND ((C-O)(O1-C1)));

ThreeInsideUpPattern = ((O2C2) AND (C1O1) AND (C1= O2) AND (C2= O1) AND ((C1-O1)(O2-C2)) AND (CO) AND (CC1) AND (OO1));

PiercingLine = ((C1O1) AND (((O1+C1)/2)C) AND (OC) AND (OC1) AND (CO1) AND ((C-O)/(0.001+(H-L))0.6));

BearishHarami = ((C1O1) AND (OC) AND (O= C1) AND (O1= C) AND ((O-C)(C1-O1)));

ThreeInsideDownPattern = ((C2O2) AND (O1C1) AND (O1= C2) AND (O2= C1) AND ((O1-C1)(C2-O2)) AND (OC) AND (CC1) AND (OO1));

ThreeWhiteSoldiers = (CO*1.01) AND (C1O1*1.01) AND (C2O2*1.01) AND (CC1) AND (C1C2) AND (OC1) AND (OO1) AND (O1C2) AND (O1O2) AND (((H-C)/(H-L))0.2) AND (((H1-C1)/(H1-L1))0.2) AND (((H2-C2)/(H2-L2))0.2);

DarkCloudCover = (C1O1*1.01) AND (OC) AND (OH1) AND (CO1) AND (((C1+O1)/2)C) AND (CO1) AND (MA(C,13)-Ref(MA(C,13),-4)0);

ThreeBlackCrows = (OC*1.01) AND (O1C1*1.01) AND (O2C2*1.01) AND (CC1) AND (C1C2) AND (OC1) AND (OO1) AND (O1C2) AND (O1O2) AND (((C-L)/(H-L))0.2) AND (((C1-L1)/(H1-L1))0.2) AND (((C2-L2)/(H2-L2))0.2);

eveningStar=Ref(LargeBody,-2) AND Ref(whiteBody,-2) AND Ref(upGap,-1) AND NOT Ref(largeBody,-1) AND blackBody AND NOT smallBody AND (MHT OR MHY);

morningStar =Ref(largeBody,-2) AND Ref(blackBody,-2) AND Ref(downGap,-1) AND whiteBody AND LargeBody AND CRef(C,-2) AND MLY;

MATCHLOW = LLV(Low,8)==LLV(Low,2) AND Ref(Close,-1)=Ref(Open,-1)*.99 AND abs(Close-Ref(Close,-1))=Close*.0025 AND OpenRef(Close,-1) AND Open=(High-((High-Low)*.5));

DoubleGapDown = GapDown() AND Ref(GapDown(),-1);

WriteIf(HangingMan, Hanging Man,

WriteIf(ShootingStar, Shooting Star,

WriteIf(DarkCloudCover, Dark Cloud Cover,

WriteIf(BearishEngulfing, Bearish Engulfing,

WriteIf(BearishHarami, Bearish Harami,

WriteIf(eveningStar, Evening Star,

WriteIf(InvertedHammer, Inverted Hammer,

WriteIf(PiercingLine, Piercing Line,

WriteIf(BullishEngulfing, Bullish Engulfing,

WriteIf(BullishHarami, Bullish Harami,

WriteIf(morningStar, Morning Star,

WriteIf(BigGapDown, Big Gap Down,

WriteIf(HugeGapDown, Huge Gap Down,

WriteIf(DoubleGapUp, Double Gap Up,

WriteIf(DoubleGapDown, DoubleGapDown,

TweezerTop=abs(H-Ref(H,-1))=H*0.0025 AND O C AND (Ref(C,-1) Ref(O,-1))AND (MHT OR MHY);

tweezerBottom= (abs(L-Ref(L,-1))/L0.0025 OR

abs(L-Ref(L,-2))/L0.0025) AND O C AND (Ref( O,-1) Ref(C,-1)) AND (MLT OR MLY);

PATTERN = WriteIf(tweezerTop, Tweezer Top,

WriteIf(tweezerBottom, Tweezer Bottom,Zilch ));

smallBody=(O=C*(1-smallBodyMaximum) AND whiteBody) OR (C=O*(1-smallBodyMaximum) AND blackBody);

largeBody=(C=O*(1+largeBodyMinimum) AND whiteBody) OR C=O*(1-largeBodyMinimum) AND blackBody;

identicalBodies=abs(abs(Ref(O,-1)-Ref(C,-1))-abs(O-C)) abs(O-C)*smallBodyMaximum;

smallUpperShadow=(whiteBody AND H=C*(1+smallBodyMaximum)) OR (blackBody AND H=O*(1+smallBodyMaximum));

smallLowerShadow=(whiteBody AND L=O*(1-smallBodyMaximum)) OR (blackBody AND L=C*(1-smallBodyMaximum));

largeUpperShadow=(whiteBody AND H=C*(1+largeBodyMinimum)) OR (blackBody AND H=O*(1+largeBodyMinimum));

largeLowerShadow=(whiteBody AND L=O*(1-largeBodyMinimum)) OR (blackBody AND L=C*(1-largeBodyMinimum));

upGap= IIf(Ref(blackBody,-1)AND whiteBody AND ORef(O,-1),1,

IIf(Ref(blackbody,-1) AND blackBody AND CRef(O,-1),1,

IIf(Ref(whiteBody,-1) AND whiteBody AND ORef(C,-1),1,

IIf(Ref(whiteBody,-1) AND blackBody AND CRef(C,-1),1,0))));

downGap=IIf(Ref(blackBody,-1)AND whiteBody AND CRef(C,-1),1,

IIf(Ref(blackbody,-1) AND blackBody AND ORef(C,-1),1,

IIf(Ref(whiteBody,-1) AND whiteBody AND CRef(O,-1),1,

IIf(Ref(whiteBody,-1) AND blackBody AND ORef(O,-1),1,0))));

Today is the maximum High in the last 5 days*/

Yesterday is the maximum High in the last 5 days*/

Yesterday is the minimum Low in the last 5 days*/

DT = abs(C-O) = (C*smallBodyMaximum) OR (abs(O-C)=((H-L)*0.1));

DY = abs(Ref ( C, -1)-Ref(O,-1)) = Ref ( C, -1) *smallBodyMaximum OR abs (Ref ( O, -1)-Ref(C,-1)) = (Ref ( H, -1 ) Ref ( L, -1 ) )*0.1;

LongBlackCandle = (OC AND (O-C)/(0.001+H-L)0.6);

SmallBlackCandle = ((OC) AND ((H-L)(3*(O-C))));

LongWhiteCandle = ((CO) AND ((C-O)/(0.001+H-L)0.6));

SmallWhiteCandle = ((CO) AND ((H-L)(3*(C-O))));

HangingMan = (((H-L)4*(O-C)) AND ((C-L)/(0.001+H-L)= 0.75) AND ((O-L)/(0.001+H-L)= 0.75));

Hammer = (((H-L)3*(O-C)) AND ((C-L)/(0.001+H-L)0.6) AND ((O-L)/(0.001+H-L)0.6));

InvertedHammer = (((H-L)3*(O-C)) AND ((H-C)/(0.001+H-L)0.6) AND ((H-O)/(0.001+H-L)0.6));

ShootingStar = (((H-L)4*(O-C)) AND ((H-C)/(0.001+H-L)= 0.75) AND ((H-O)/(0.001+H-L)= 0.75));

BlackSpinningTop = ((OC) AND ((H-L)(3*(O-C))) AND (((H-O)/(0.001+H-L))0.4) AND (((C-L)/(0.001+H-L))0.4));

WhiteSpinningTop = ((CO) AND ((H-L)(3*(C-O))) AND (((H-C)/(0.001+H-L))0.4) AND (((O-L)/(0.001+H-L))0.4));

BearishAbandonedBaby = ((C1 == O1) AND (C2O2) AND (OC) AND (L1H2) AND (L1H));

BearishEveningDojiStar = ((C2O2) AND ((C2-O2)/(0.001+H2-L2)0.6) AND (C2O1) AND (C1O1) AND ((H1-L1)(3*(C1-O1))) AND (OC) AND (OO1));

DarkCloudCover = (C1O1 AND ((C1+O1)/2)C AND OC AND OC1 AND CO1 AND (O-C)/(0.001+(H-L)0.6));

BearishEngulfing = ((C1O1) AND (OC) AND (O= C1) AND (O1= C) AND ((O-C)(C1-O1)));

ThreeOutsideDownPattern = ((C2O2) AND (O1C1) AND (O1= C2) AND (O2= C1) AND ((O1-C1)(C2-O2)) AND (OC) AND (CC1));

BullishAbandonedBaby = ((C1 == O1) AND (O2C2) AND (CO) AND (L2H1) AND (LH1));

BullishMorningDojiStar = ((O2C2) AND ((O2-C2)/(0.001+H2-L2)0.6) AND (C2O1) AND (O1C1) AND ((H1-L1)(3*(C1-O1))) AND (CO) AND (OO1));

BullishEngulfing = ((O1C1) AND (CO) AND (C= O1) AND (C1= O) AND ((C-O)(O1-C1)));

ThreeOutsideUpPattern = ((O2C2) AND (C1O1) AND (C1= O2) AND (C2= O1) AND ((C1-O1)(O2-C2)) AND (CO) AND (CC1));

BullishHarami = ((O1C1) AND (CO) AND (C= O1) AND (C1= O) AND ((C-O)(O1-C1)));

ThreeInsideUpPattern = ((O2C2) AND (C1O1) AND (C1= O2) AND (C2= O1) AND ((C1-O1)(O2-C2)) AND (CO) AND (CC1) AND (OO1));

PiercingLine = ((C1O1) AND (((O1+C1)/2)C) AND (OC) AND (OC1) AND (CO1) AND ((C-O)/(0.001+(H-L))0.6));

BearishHarami = ((C1O1) AND (OC) AND (O= C1) AND (O1= C) AND ((O-C)(C1-O1)));

ThreeInsideDownPattern = ((C2O2) AND (O1C1) AND (O1= C2) AND (O2= C1) AND ((O1-C1)(C2-O2)) AND (OC) AND (CC1) AND (OO1));

ThreeWhiteSoldiers = (CO*1.01) AND (C1O1*1.01) AND (C2O2*1.01) AND (CC1) AND (C1C2) AND (OC1) AND (OO1) AND (O1C2) AND (O1O2) AND (((H-C)/(H-L))0.2) AND (((H1-C1)/(H1-L1))0.2) AND (((H2-C2)/(H2-L2))0.2);

DarkCloudCover = (C1O1*1.01) AND (OC) AND (OH1) AND (CO1) AND (((C1+O1)/2)C) AND (CO1) AND (MA(C,13)-Ref(MA(C,13),-4)0);

ThreeBlackCrows = (OC*1.01) AND (O1C1*1.01) AND (O2C2*1.01) AND (CC1) AND (C1C2) AND (OC1) AND (OO1) AND (O1C2) AND (O1O2) AND (((C-L)/(H-L))0.2) AND (((C1-L1)/(H1-L1))0.2) AND (((C2-L2)/(H2-L2))0.2);

eveningStar=Ref(LargeBody,-2) AND Ref(whiteBody,-2) AND Ref(upGap,-1) AND NOT Ref(largeBody,-1) AND blackBody AND NOT smallBody AND (MHT OR MHY);

morningStar =Ref(largeBody,-2) AND Ref(blackBody,-2) AND Ref(downGap,-1) AND whiteBody AND LargeBody AND CRef(C,-2) AND MLY;

MATCHLOW = LLV(Low,8)==LLV(Low,2) AND Ref(Close,-1)=Ref(Open,-1)*.99 AND abs(Close-Ref(Close,-1))=Close*.0025 AND OpenRef(Close,-1) AND Open=(High-((High-Low)*.5));

DoubleGapDown = GapDown() AND Ref(GapDown(),-1);

WriteIf(HangingMan, Hanging Man,

WriteIf(ShootingStar, Shooting Star,

WriteIf(DarkCloudCover, Dark Cloud Cover,

WriteIf(BearishEngulfing, Bearish Engulfing,

WriteIf(BearishHarami, Bearish Harami,

WriteIf(eveningStar, Evening Star,

WriteIf(InvertedHammer, Inverted Hammer,

WriteIf(PiercingLine, Piercing Line,

WriteIf(BullishEngulfing, Bullish Engulfing,

WriteIf(BullishHarami, Bullish Harami,

WriteIf(morningStar, Morning Star,

WriteIf(BigGapDown, Big Gap Down,

WriteIf(HugeGapDown, Huge Gap Down,

WriteIf(DoubleGapUp, Double Gap Up,

WriteIf(DoubleGapDown, DoubleGapDown,

TweezerTop=abs(H-Ref(H,-1))=H*0.0025 AND O C AND (Ref(C,-1) Ref(O,-1));

tweezerBottom= (abs(L-Ref(L,-1))/L0.0025 OR

abs(L-Ref(L,-2))/L0.0025) AND O C AND (Ref( O,-1) Ref(C,-1));

PATTERN = WriteIf(tweezerTop, Tweezer Top,

WriteIf(tweezerBottom, Tweezer Bottom,Zilch ));

//AddTextColumn(PATTERN, Tweezer Pattern, 5.6, colorWhite, IIf(TweezerTop, colorRed,

//IIf(TweezerBottom, colorGreen, colorLightGrey)));

//AddTextColumn(C_Status, Candle Pattern, 5.6, colorWhite, IIf(HangingMan OR ShootingStar OR DarkCloudCover OR BearishEngulfing OR BearishHarami OR eveningStar, colorRed,

//IIf(Hammer OR InvertedHammer OR PiercingLine OR BullishEngulfing OR BullishHarami OR morningStar OR MATCHLOW, colorGreen, IIf( NearDoji OR Doji, colorBlue, colorLightGrey))));

AddTextColumn(P_Status, Price Pattern, 5.6, colorWhite, IIf(GapDownx OR BigGapDown OR HugeGapDown OR DoubleGapDown, colorRed,

IIf(GapUpx OR BigGapUp OR HugeGapUp OR DoubleGapUp, colorGreen, colorLightGrey)));

AddTextColumn(PATTERN + And + C_Status, Tweezer Pattern , 5.6, colorWhite, IIf(TweezerTop, colorRed,

IIf(TweezerBottom, colorGreen, colorLightGrey)));

AddColumn(C, CURRENT PRICE,1.2, IIf(C Ref(C,-1),colorGreen,colorRed));

AddColumn(V, VOL TODAY ,1.2, IIf(V MA(V,20),colorGreen, colorLightGrey));

/************************************************** *****

Load this file into the Commentary Option of the Analysis tab. Green arrows indicate bullish candles.

Red arrows indicate bearish candles. Scroll down the commentary for comments.

This is a work in progress. Thanks to all on this forum whose code I may have incorporated into this file. Comments are from Steve Nison Japanese Candlestick Charting Techniques and the LitWick web site.

************************************************** ********/

smallBody=(O=C*(1-smallBodyMaximum) AND whiteBody)

OR (C=O*(1-smallBodyMaximum) AND blackBody);

largeBody=(C=O*(1+largeBodyMinimum) AND whiteBody)

OR C=O*(1-largeBodyMinimum) AND blackBody;

identicalBodies=abs(abs(Ref(O,-1)-Ref(C,-1))-abs(O-C))

smallUpperShadow=(whiteBody AND H=C*(1+smallBodyMaximum))

OR (blackBody AND H=O*(1+smallBodyMaximum));

smallLowerShadow=(whiteBody AND L=O*(1-smallBodyMaximum))

OR (blackBody AND L=C*(1-smallBodyMaximum));

largeUpperShadow=(whiteBody AND H=C*(1+largeBodyMinimum))

OR (blackBody AND H=O*(1+largeBodyMinimum));

largeLowerShadow=(whiteBody AND L=O*(1-largeBodyMinimum))

OR (blackBody AND L=C*(1-largeBodyMinimum));

upGap= IIf(Ref(blackBody,-1)AND whiteBody AND ORef(O,-1),1,

IIf(Ref(blackbody,-1) AND blackBody AND CRef(O,-1),1,

IIf(Ref(whiteBody,-1) AND whiteBody AND ORef(C,-1),1,

IIf(Ref(whiteBody,-1) AND blackBody AND CRef(C,-1),1,0))));

downGap=IIf(Ref(blackBody,-1)AND whiteBody AND CRef(C,-1),1,

IIf(Ref(blackbody,-1) AND blackBody AND ORef(C,-1),1,

IIf(Ref(whiteBody,-1) AND whiteBody AND CRef(O,-1),1,

IIf(Ref(whiteBody,-1) AND blackBody AND ORef(O,-1),1,0))));

doji=CdDoji(threshold=0.05);/*abs(C-O) = (C*smallBodyMaximum) OR

dojiStar=doji AND (upgap OR downgap)AND Ref(LargeBody,-1);

marabuzu=LargeBody AND smallUpperShadow AND smallLowerShadow;

shootingStar=/*(NOT largeBody AND smallLowerShadow AND LargeUpperShadow) OR*/

((blackBody AND abs(O-H)2*realBodySize) OR

((blackBody AND abs(C-L)2*realBodySize) OR

IIf(blackBody AND Ref(blackbody,-1) AND CRef(C,-1) AND ORef(O,-1),1,

IIf(blackBody AND Ref(whiteBody,-1) AND ORef(C,-1) AND CRef(O,-1),1,

IIf(whitebody AND Ref(whitebody,-1) AND CRef(C,-1) AND ORef(O,-1),1,

IIf(whiteBody AND Ref(blackBody,-1) AND CRef(O,-1)AND ORef(C,-1),1,0))));

IIf(blackbody AND Ref(blackBody,-1) AND ORef(O,-1) AND CRef(C,-1),1,

IIf(blackBody AND Ref(whiteBody,-1) AND CRef(O,-1) AND ORef(C,-1),1,

IIf(whiteBody AND Ref(whiteBody,-1) AND CRef(C,-1) AND ORef(O,-1),1,

IIf(whiteBody AND Ref(blackBody,-1) AND ORef(C,-1) AND CRef(O,-1),1,0))));

Today is the maximum High in the last 5 days*/

Yesterday is the maximum High in the last 5 days*/

Yesterday is the minimum Low in the last 5 days*/

DY = abs(Ref ( C, -1)-Ref(O,-1)) = Ref ( C, -1) *smallBodyMaximum OR

abs (Ref ( O, -1)-Ref(C,-1)) = (Ref ( H, -1 ) Ref ( L, -1 ) )*0.1;

/**************************************************

************************************************** * */

abandonedBabybullish =Ref(largeBody,-2) AND Ref(blackBody,-2)//Large black candle

AND whiteBody AND LargeBody AND GapUp();//Large white candle

beltHoldBullish = largeBody AND smallLowerShadow AND whiteBody AND MLT;

breakAwayBullish=Ref(Largebody,-4) AND Ref(blackBody,-4)

AND Ref(blackBody,-3) AND Ref(O,-3)Ref(C,-4)

AND Ref(smallbody,-2) AND Ref(C,-2)Ref(C,-3)

AND LargeBody AND whiteBody AND CRef(O, -3)

ConcealingBabySwallow=Ref(marabuzu,-3) AND Ref(blackbody,-3) AND

Ref(H,-1)Ref(C,-2)AND Ref(blackbody,-1)AND

(doji AND (CRef(C,-1) OR ORef(C,-1))AND Ref(blackBody,-1)

dragonflyDoji=smallBody AND LargeLowerShadow AND smallUpperShadow AND MLT;

haramiBullish = harami AND Ref (LargeBody,-1) AND Ref(blackBody,-1) AND

HaramiCross=harami AND Ref(LargeBody,-1) AND Ref(blackBody,-1) AND doji;

homingPigeon = Ref(largeBody,-1) AND Ref(blackBody,-1) AND

H= Ref ( O, -1 ) AND L=Ref( C, -1) AND CO AND MLY;

meetingLinesbullish= Ref(LargeBody,-1) AND Ref(blackBody,-1) AND

CRef(C,-1)*0.9975 AND C Ref(C,-1)*1.0025;

morningDojiStar= Ref(LargeBody,-2) AND Ref(blackBody,-2) AND

morningStar =Ref(largeBody,-2) AND Ref(blackBody,-2)//Large black candle

AND whiteBody AND LargeBody AND CRef(C,-2)//Large white candle today

piercingLine= Ref(largeBody,-1) AND Ref(blackBody,-1)AND

ORef(L,-1) AND C=(Ref(O,-1)+Ref(C,-1))/2 AND CRef(O,-1) AND MLT;

stickSandwich=Ref(largeBody,-2) AND Ref(blackbody,-2) AND

Ref(O,-1)=Ref(C,-2) AND O=Ref(C,-1) AND

threeInsideUp =Ref(Haramibullish,-1) AND whiteBody AND

threeOutsideUp =Ref(engulfingBullish,-1) AND whiteBody AND CRef(C,-1);

Ref(LargeBody,-2) AND Ref(blackBody,-2) AND Ref(largelowerShadow,-2)

AND Ref(blackBody,-1) AND Ref(largeLowerShadow,-1) AND

Ref(L,-1)Ref(L,-2) AND blackBody AND smallUpperShadow AND

smallLowerShadow AND LRef(L,-1) AND HRef(H,-1);

triStarBullish=Ref(doji,-2) AND Ref(doji,-1) AND doji AND MLY AND

threeriverBottom=Ref(largeBody,-2) AND Ref(blackBody,-2) AND

Ref(blackbody,-1) AND Ref(Largelowershadow,-1) AND

Ref(O,-1)Ref(O,-2) AND Ref(C,-1)Ref(C,-2) AND

MAtHoldBullish=Ref(LargeBody,-4) AND Ref(whiteBody,-4)//1st day

AND Ref(blackBody,-3) AND Ref(upGap,-3) AND NOT Ref(LargeBody,-3)

AND NOT Ref(LargeBody,-2) AND Ref(C,-2)Ref(C,-3) AND Ref (O,-2)Ref(O,-3) AND

Ref(C,-2)Ref(O,-4) AND NOT Ref(LargeBody,-1) AND Ref(C,-1)Ref(C,-2)

AND LargeBody AND whiteBody AND CRef(C,-4);

risingThreeMethods=Ref(LargeBody,-4) AND Ref(whiteBody,-4) AND NOT

Ref(LargeBody,-3) AND NOT Ref(LargeBody,-2)AND NOT Ref(LargeBody,-1) AND

Ref(C,-3)Ref(C,-4) AND Ref(C,-2)Ref(C,-3) AND Ref(C,-1)Ref(C,-2) AND

separatingLinesBullish=Ref(blackBody,-1) AND whiteBody AND LargeBody AND

smallLowerShadow AND MHT AND abs(O-Ref(O,-1))=O*0.0025;

sideBySideWhiteLines=NOT Ref(smallBody,-2) AND Ref(whiteBody,-2)

AND Ref(upGap,-1) AND Ref(whitebody,-1)AND whiteBody AND

identicalBodies AND abs(O-Ref(O,-1))O*0.0025;

threeWhiteSoldiers=NOT Ref(smallbody,-2) AND Ref(whiteBody,-2) AND NOT

Ref(smallBody,-1) AND Ref(whiteBody,-1) AND NOT

smallBody AND whiteBody AND CRef(C,-1) AND Ref(C,-1)Ref(C,-2) AND

Ref(O,-1)Ref(O,-2) AND Ref(O,-1)Ref(C,-2) AND ORef(C,-1) AND

ORef(O,-1) AND Ref(smallUpperShadow,-2) AND

Ref(smallUpperShadow,-1) AND smallUppershadow AND LLV(L,12)==Ref(L,-2);

upsideGapThreeMethods=Ref(Largebody,-2) AND Ref(whiteBody,-2) AND

Ref(LargeBody,-1) AND Ref(whiteBody,-1) AND Ref(upGap,-1) AND

blackBody AND ORef(O,-1) AND CRef(C,-2)AND CRef(O,-2) AND

threeLineStrike=NOT Ref(smallBody,-3) AND NOT Ref(smallBody,-2) AND

NOT Ref(smallBody,-1) AND Ref(whiteBody,-3) AND Ref(whiteBody,-2) AND

Ref(whiteBody,-1) AND Ref(C,-1)Ref(C,-2) AND Ref(C,-2)Ref(C,-3) AND

blackBody AND ORef(C,-1) AND CRef(O,-3);

tweezerBottom= (abs(L-Ref(L,-1))/L0.0025 OR

abs(L-Ref(L,-2))/L0.0025) AND O C AND (Ref( O,-1) Ref(C,-1));

upsideTasukiGap=Ref(largeBody,-2) AND Ref(largeBody,1) AND

Ref(whiteBody,-2) AND Ref(whiteBody,-1) AND Ref(upGap,-1) AND

blackBody AND ORef(O,-1) AND CRef(O,-1) AND CRef(C,-2) AND

//AND HHV(H,5)==Ref(H,-1); Do not use this line

AbandonedBabyBearish=Ref(LargeBody,-2) AND Ref(whiteBody,-2) AND

Ref(smallBody,-1) AND Ref(GapUp(),-1) AND GapDown() AND

AdvanceBlockBearish=Ref(LargeBody,-2) AND Ref(whiteBody,-2)

whiteBody AND Ref(O,-1)Ref(O,-2) AND Ref(O,-1)Ref(C,-2) AND

ORef(C,-1) AND ORef(O,-1) AND Ref(LargeUpperShadow,-1) AND LargeUpperShadow

AND C-ORef(C,-1)-Ref(O,-1) AND Ref(C,-1)-Ref(O,-1) Ref(C,-2)-Ref(O,-2);

beltHoldBearish=LargeBody AND BlackBody AND smalluppershadow AND MHT;

breakAwayBearish=Ref(LargeBody,-4) AND Ref(whiteBody,-4) AND

blackBody AND ORef(O,-3) AND CRef(C,-4);

darkCloudCover=Ref(LargeBody,-1) AND Ref(whiteBody,-1) AND

blackBody AND ORef(H,-1) AND CRef(O,-1) AND C(Ref(O,-1)+Ref(C,-1))/2

deliberationBearish=Ref(LargeBody,-2) AND Ref(whiteBody,-2) AND

Ref(LargeBody,-1) AND Ref(whiteBody,-1) AND Ref(C,-1)Ref(C,-2) AND

CounterAttackBearish=MHT AND LargeBody AND blackbody AND

CRef(C,-1)*1.0025 AND CRef(C,-1)*0.9975;;

(doji AND (CRef(C,-1) OR ORef(C,-1))AND Ref(whiteBody,-1)

engulfingBearish=engulfing AND largeBody AND blackBody AND

(Ref(whitebody,-1) OR Ref(Doji,-1))AND (MHT OR MHY);

eveningDojiStar=Ref(LargeBody,-2) AND Ref(whiteBody,-2) AND

Ref(dojiStar,-1) AND Ref(GapUp(),-1) AND (MHY OR MHT);

eveningStar=Ref(LargeBody,-2) AND Ref(whiteBody,-2) AND

Ref(upGap,-1) AND NOT Ref(largeBody,-1) AND blackBody AND NOT smallBody AND

HangingMan=NOT largeBody AND smallUpperShadow AND LargeLowerShadow AND MHT;

dragonflyDojiBearish=doji AND smallUpperShadow AND LargeLowerShadow AND MHT;

HaramiBearish=harami AND Ref(Largebody,-1) AND Ref(whiteBody,-1)AND blackBody

HaramiCrossBearish=harami AND doji AND Ref(whiteBody,-1) AND Ref(Largebody,-1);

idendicalThreeBlackCrows=Ref(blackBody,-2) AND Ref(blackBody,-1) AND blackBody AND

abs(Ref(C,-2)-Ref(O,-1))Ref(C,-1)*0.0025 AND abs(Ref(C,-1)-O)O*0.0025 AND

HHV(H,20)==Ref(H,-2) AND NOT Ref(doji,-2) AND NOT Ref(doji,-1) AND NOT doji AND

Ref(smallLowerShadow,-2) AND Ref(smallLowerShadow,-1) AND smallLowerShadow;

kickingBearish=Ref(whiteBody,-1) AND Ref(MArabuzu,-1) AND blackBody AND MArabuzu AND GapDown();

MeetingLinesBearish=Ref(LargeBody,-1) AND Ref(whiteBody,-1) AND

HHV(C,8)==Ref(C,-1) AND LargeBody AND blackBody AND

shootingStarGap=shootingStar AND GapUp() AND MHT;

gravestoneDoji=doji AND largeUpperShadow AND smallLowerShadow AND GapUp()AND MHT;

threeInsideDownBearish=Ref(HaramiBearish,-1) AND blackBody AND CRef(C,-1)AND smallUpperShadow;

threeoutsideDownBearish=Ref(engulfingBearish,-1) AND blackBody AND CRef(C,-1)AND

triStarBearish=Ref(doji,-2) AND Ref(doji,-1) AND doji AND MHY AND Ref(upGap,-1)AND downGap;

twoCrows=Ref(whiteBody,-2) AND Ref(LargeBody,-2) //first day

AND Ref(blackBody,-1) AND Ref(upGap,-1)//Second Day

AND blackBody AND ORef(O,-1) AND ORef(C,-1)AND CRef(C,-2) AND

upsideGapTwoCrows= Ref(whiteBody,-2) AND Ref(LargeBody,-2)// first day

AND Ref(upGap,-1) AND Ref(blackBody,-1) // 2nd day

AND blackbody AND ORef(O,-1) AND CRef(C,-1) AND CRef(C,-2);

dojiStarBearish=Ref(LargeBody,-1) AND Ref(whiteBody,-1) // first day

Ref(LargeBody,-2) AND Ref(blackBody,-2) AND Ref(downGap,-2) //first day

AND Ref(LargeBody,-1) AND Ref(blackBody,-1)//2nd day

AND whitebody AND ORef(O,-1) AND CRef(C,-2)

AND Ref(blackbody,-1) AND Ref(downgap,-1) //2nd day

AND whiteBody AND ORef(O,-1) AND ORef(C,-1) AND CRef(O,-1) AND CRef(C,-2)

fallingThreeMethods=Ref(LargeBody,-4) AND Ref(blackBody,-4) AND

/*Ref(doji,-3) AND Ref(doji,-2) AND Ref(doji,-1) AND*/ Ref(C,-1)Ref(C,-2)

AND Ref(C,-2)Ref(C,-3) AND LargeBody AND blackBody AND ORef(C,-4) AND

ORef(O,-4) AND CRef(O,-4)AND CRef(C,-4);

inNeckBearish=Ref(LargeBody,-1) AND Ref(blackBody,-1) AND

whiteBody AND ORef(L,-1) AND CRef(C,-1)*1.0005 AND C=Ref(C,-1);

OnNeckBearish=Ref(LargeBody,-1) AND Ref(blackBody,-1) AND

whiteBody AND ORef(L,-1) AND CRef(L,-1)*1.0025 AND C=Ref(L,-1)*0.9975;

separatingLinesBearish=Ref(LargeBody,-1) AND Ref(whiteBody,-1) AND

blackBody AND ORef(O,-1)*0.9975 AND O=Ref(O,-1)*1.0025;

sideBySideWhiteLinesBearish=NOT Ref(smallBody,-2) AND Ref(blackBody,-2) AND

Ref(whiteBody,-1) AND whiteBody AND Ref(downGap,-1) AND identicalBodies

threeBlackCrows=Ref(blackBody,-2) AND Ref(blackBody,-1) AND blackBody AND Ref(C,-1)Ref(C,-2) AND CRef(C,-1) AND HHV(H,8)==Ref(H,-2) AND NOT Ref(doji,-2) AND NOT Ref(doji,-1) AND NOT doji;;

threeLineStrike=threeBlackCrows AND whiteBody AND ORef(C,-1) AND CRef(O,-3);

thrustingBearish=Ref(blackBody,-1) AND Ref(LargeBody,-1) AND LargeBody AND

whitebody AND ORef(L,-1) AND C(Ref(O,-1)+Ref(C,-1))/2 AND CRef(C,-1);

TweezerTop=abs(H-Ref(H,-1))=H*0.0025 AND O C AND (Ref(C,-1) Ref(O,-1));

/* ***********************************************

**************************************************/

WriteIf(abandonedBabybullish,Abandoned Baby Bullish. A reversal pattern.\nLiWick reliability : High.,

WriteIf(beltHoldBullish,Belt Hold Bullish. A reversal pattern.\nNison:The larger the candlestick, the more significant it is.\nLitWick Reliability: Low.,

WriteIf(breakAwayBullish,Break Away Bullish. A reversal pattern.\nLitWick reliability: moderate.,

WriteIf(ConcealingBabySwallow,Concealing Baby Swallow. A reversal pattern.\n LitWick reliability: high.,

WriteIf(dojiStarBullish,Bullish doji Star. A reversal pattern.\nNison: Needs confirmation. Better at calling tops.\nLitWick reliability: moderate.,

WriteIf(engulfingBullish,Bullish Engulfing. a reversal pattern.\nNison: Factors increasing the patterns effectiveness are\n1) The first day has a small real body and the second day has a large real body.\n2) Pattern appears after protracted or very fast move.\n3) Heavy volume on second real body.\n4) The second day engulfs more than one real body.\nLitWick reliability: moderate,

WriteIf(hammerBullish,Bullish Hammer. A reversal pattern.\nNison: The longer the lower shadow, the smaller the upper shadow, and the smaller