Candlesticks Patterns Identified

I was using another script that colored the bars to show the different candle patterns. Thanks to HPotter ( Unfortunately, I can't think that fast when looking across a screen of charts with different color bars. Fortunately, Tradingview came up with symbols and names on 2/26/15. I decided to take my favorite symbols and attach them to a name. This makes it easier to see what is going on and where your entry would be if it confirms. Works beautifully for me. Decided to share. I also added the ability to alter what shows up based upon a look back. A bullish engulfing at the top of a trend, or a bearish harami at the bottom of the trend, is nearly useless and clutters the chart. I have the default set for the open of the current bar to be higher or lower than the open from 5 bars back. You can adjust in the settings to what you like. This trend setting is on all the patterns except doji . If you want to see all the candle patterns, set it to "1".

The doji can be adjusted as well. I left some other patterns at the bottom of the script, but they are turned off. They became too much of a clutter for me. I prefer DovCaspi's pattern finder for hammers and stars:
Hammer, Hanging man, Shooting start, Inverted hammer markers
I use his due to the clean appearance.

The default script has: Doji , Bearish Harami, Bullish Harami, Bearish Engulfing , Bullish Engulfing , Piercing Line, Bullish Belt, Bullish Kicker, and Bearish Kicker. You can turn off what you don't like. The Piercing Line, Bullish Belt, and the Kickers will usually show up better in the daily charts .

If you would like the updated version, see the Related Ideas below:
Remove from Favorite Scripts Add to Favorite Scripts
// Created by Robert N. 030715
// Candle labels
study(title = "Candles", overlay = true)

trend= input(5, minval=1, title="Trend in Bars")

DojiSize = input(0.05, minval=0.01, title="Doji size")
data=(abs(open - close) <= (high - low) * DojiSize)
plotchar(data, title="Doji", text='Doji', color=white)

data6=(close[1] > open[1] and open > close and open <= close[1] and open[1] <= close and open - close < close[1] - open[1] and open[trend] < open)
plotshape(data6, title= "Bearish Harami", color=red, style=shape.arrowdown, text="Bearish\nHarami")

data7=(open[1] > close[1] and close > open and close <= open[1] and close[1] <= open and close - open < open[1] - close[1] and open[trend] > open)
plotshape(data7,  title= "Bullish Harami", location=location.belowbar, color=lime, style=shape.arrowup, text="Bullish\nHarami")

data8=(close[1] > open[1] and open > close and open >= close[1] and open[1] >= close and open - close > close[1] - open[1] and open[trend] < open)
plotshape(data8,  title= "Bearish Engulfing", color=red, style=shape.arrowdown, text="Bearish\nEngulfing")

data9=(open[1] > close[1] and close > open and close >= open[1] and close[1] >= open and close - open > open[1] - close[1] and open[trend] > open)
plotshape(data9, title= "Bullish Engulfing", location=location.belowbar, color=lime, style=shape.arrowup, text="Bullish\nEngulfling")

upper = highest(10)[1]
data10=(close[1] < open[1] and  open < low[1] and close > close[1] + ((open[1] - close[1])/2) and close < open[1] and open[trend] > open)
plotshape(data10, title= "Piercing Line", location=location.belowbar, color=lime, style=shape.arrowup, text="Piercing\nLine")

lower = lowest(10)[1]
data11=(low == open and  open < lower and open < close and close > ((high[1] - low[1]) / 2) + low[1] and open[trend] > open)
plotshape(data11, title= "Bullish Belt", location=location.belowbar, color=lime, style=shape.arrowup, text="Bullish\nBelt")

data12=(open[1]>close[1] and open>=open[1] and close>open and open[trend] > open)
plotshape(data12, title= "Bullish Kicker", location=location.belowbar, color=lime, style=shape.arrowup, text="Bullish\nKicker")

data13=(open[1]<close[1] and open<=open[1] and close<=open and open[trend] < open)
plotshape(data13, title= "Bearish Kicker", color=red, style=shape.arrowdown, text="Bearish\nKicker")

//data14=(((high-low>4*(open-close))and((close-low)/(.001+high-low)>=0.75)and((open-low)/(.001+high-low)>=0.75))and open[trend] < open and high[1] < open and high[2] < open)
//plotshape(data14,  title= "Hanging Man", color=red, style=shape.arrowdown, text="Hanging\nMan")

//data2=(close[2] > open[2] and min(open[1], close[1]) > close[2] and open < min(open[1], close[1]) and close < open )
//plotshape(data2, title= "Evening Star", color=red, style=shape.arrowdown, text="Evening Star")

//data3=(close[2] < open[2] and max(open[1], close[1]) < close[2] and open > max(open[1], close[1]) and close > open )
//plotshape(data3,  title= "Morning Star", location=location.belowbar, color=lime, style=shape.arrowup, text="Morning\nStar")

//data4=(open[1] < close[1] and open > close[1] and high - max(open, close) >= abs(open - close) * 3 and min(close, open) - low <= abs(open - close))
//plotshape(data4, title= "Shooting Star", color=red, style=shape.arrowdown, text="Shooting\nStar")

//data5=(((high - low)>3*(open -close)) and  ((close - low)/(.001 + high - low) > 0.6) and ((open - low)/(.001 + high - low) > 0.6))
//plotshape(data5, title= "Hammer",, color=white, style=shape.diamond, text="Hammer")

//data5b=(((high - low)>3*(open -close)) and  ((high - close)/(.001 + high - low) > 0.6) and ((high - open)/(.001 + high - low) > 0.6))
//plotshape(data5b, title= "Inverted Hammer",, color=white, style=shape.diamond, text="Inverted\nHammer")

Good Script, I like it When someone does the stuff for me.
repo32 PRO ucsgears
Thanks. I really enjoy all your scripts. Very impressive resume there.
So did KirillTrade036477 use your code from the version with the trend filter? Or did you use his code? I'm confused :)

repo32 PRO ChartArt
He copied mine completely. You can goto all scripts and see his original one was entered a couple of days ago, mine is nearly a week ago now. He only removed the created by Robert N. at the top. Would have been cool if he could of improved on it or something. Oh well.
+1 Reply
iqs PRO repo32
hi ! good work !
Does it repainting ?
Sorry, no. You can manipulate the code to repaint the bars though. I have several different versions in my personal library. One of them paints the confirmation bar after a reversal candle.
trigger = input(8, minval=1, title="Trigger EMA")
tline = ema(close, trigger)
plot(tline, color=yellow, title="Trigger EMA")
abovet = close > tline, belowt = close < tline
abovet2 = close > tline, belowt2 = close < tline
Please tell me which software this code is for?
repo32 PRO LeHoangTung
It is for TradingView.
NicholasB LeHoangTung
pine editor, trading view charts
United States
United Kingdom
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out