Five Candlestick Patterns : The 5 most powerful classical Candlestick Patterns
Trend reversal and continuation patterns Based on the work of Thomas Bulkowski in his book: “Encyclopedia of Candlestick Charts”, 2008 Read a summary here: https://www.investopedia.com/articles/active-trading/092315/5-most-powerful-candlestick-patterns.asp
This *market-wide screener* works along similar lines as this *fund-specific indicator* in the PRC library list: “Candlestick patterns recognition”
// Five Candlestick Patterns
//
// The 5 most powerful classical Candlestick Patterns
// Trend reversal and continuation patterns
// Coded by Violet
// 4-12-2017
//
// Based on the work of Thomas Bulkowski in his book: "Encyclopedia of Candlestick Charts", 2008
// Read a summary here: https://www.investopedia.com/articles/active-trading/092315/5-most-powerful-candlestick-patterns.asp
//
// This *market-wide screener* works along similar lines as this *fund-specific indicator* in the PRC library list: "Candlestick patterns recognition"
//
// Signal codes and pattern types
//**************************************************************************
// Type Direction Bulkowski's Occurrence
// Name of pattern accuracy rate
// ------- ------------ ------------ ----------
// 1 = ThreeLineStrikeUp Bullish Reversal 84% truly rare
// 2 = TwoBlackGappingDown Bearish Continuation 68% common
// 3 = ThreeBlackCrows Bearish Continuation 78% common
// 4 = EveningStar Bearish Reversal 72% very low
// 5 = AbandonedBaby Bullish Reversal 70% low
//**************************************************************************
//
ThreeLineStrikeUp = 0
TwoBlackGappingDown = 0
ThreeBlackCrows = 0
EveningStar = 0
AbandonedBaby = 0
signal = 0
// 1 - Three Line Strike Up *************************************
// Bulkowski accuracy rate 84%, frequency: very rare
t1 = close[3] < open[3] // candle 4 = red candle
t2 = close[2] < open[2] and low[2] < low[3] and open[2] < open[3] // candle 3 = red candle, lower low & open than previous candle
t3 = close[1] < open[1] and low[1] < low[2] and open[1] < open[2] // candle 2 = red candle and lower low & open than previous candle
t4 = open[0] < low[1] and close[0] > open[3] // candle 1 = green candle, opens lower than previous candle and closes above open of 4th candle. The candle engulfs the bodies of the three preceding black candles
if t1 and t2 and t3 and t4 then
ThreeLineStrikeUp = 1
endif
// 2 - Bearish Two Black Gapping *************************
// Bulkowski accuracy rate 68%, frequency: common
b1 = close[1] < open[1] // red candle
b2 = close[0] < open[0] // followed by another red candle
b3 = high[0] < low[1] // with a down gap in between
if b1 and b2 and b3 then
TwoBlackGappingDown = 1
endif
// 3 - Three Black Crows *********************************
// Bulkowski accuracy rate 78%, frequency: very common
c1 = close[2] < open[2]
c2 = close[1] < open[1] and close[1] < low[2]
c3 = close[0] < open[0] and close[0] < low[1]
// Closing prices are less than 1/3 from lows
c4 = abs(close[2] -low[2]) < range[2] / 3
c5 = abs(close[1] -low[1]) < range[1] / 3
c6 = abs(close[0] -low[0]) < range[0] / 3
if c1 and c2 and c3 and c4 and c5 and c6 then
ThreeBlackCrows = 1
endif
// 4 Evening Star **************************************************
// Bulkowski accuracy rate 72%, frequency low
e1 = close[2] > open[2] // green candle
e2 = open[1] > close[2] and close[1] > close[2] and low[1] > close[2] // candle entirely above predecessor's body
e3 = close[0] < open[0] and high[0] < low[1] // red candle with a gap
e4 = range[1] < (range[2] / 2 ) // evening star's range is small compared to preceding candle
if e1 and e2 and e3 and e4 then
EveningStar = 1
endif
// 5 - Abandoned baby, aka Morning star ***********************
// Bulkowski accuracy rate 70%, frequenc": low
a1 = high[1] < low[2] // gap
a2 = high[1] < low[0] // gap
a3 = abs(open[1]-close[1]) < ( range[1] / 2 ) // doji like
if a1 and a2 and a3 then
AbandonedBaby = 1
endif
// Results ******************
if ThreeLineStrikeUp then
signal = 1
elsif TwoBlackGappingDown then
signal = 2
elsif ThreeBlackCrows then
signal = 3
elsif EveningStar then
signal = 4
elsif AbandonedBaby then
signal = 5
endif
//
// Pattern types
//**************************
//Type = Name of pattern
//---- -------------------
// 1 = ThreeLineStrikeUp
// 2 = TwoBlackGappingDown
// 3 = ThreeBlackCrows
// 4 = EveningStar
// 5 = AbandonedBaby
//**************************
//
screener [ signal > 0 ] sort by signal as "Type"