Candlestick Patterns Identified (updated 3/11/15)

I decided to republish this one without the trend filter and with all the major symbols active. This will allow for all the patterns to show up.
Due to 15 different candlestick formations in this one script, it will be difficult to turn off the last few due to screen size. You can turn off individual patterns on the settings screen.
I have everything spelled out except the hammer and inverted hammer . They are "H" and "IH" respectively on the charts. They show up so often that they cluttered the charts.

The default script has: Doji , Evening Star , Morning Star , Shooting Star , Hammer , Inverted Hammer , Bearish Harami, Bullish Harami, Bearish Engulfing , Bullish Engulfing , Piercing Line, Bullish Belt, Bullish Kicker, Bearish Kicker, Hanging man , and Dark Cloud Cover. 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 .

I recommend watching videos with Stephen Bigalow to get a feel for how to trade these. You will want to add an 8 EMA to your chart with his setups. Enjoy.

If you want the old version: Take a look at the related ideas below.
Remove from Favorite Scripts Add to Favorite Scripts
// Created by Robert N. 030715
// Updated 031115
// Candle labels
study(title = "Candles", overlay = true)

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)

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\nStar")

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", location=location.belowbar, color=white, style=shape.diamond, text="H")

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", location=location.belowbar, color=white, style=shape.diamond, text="IH")

data6=(close[1] > open[1] and open > close and open <= close[1] and open[1] <= close and open - close < close[1] - open[1] )
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] )
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] )
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] )
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])
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])
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)
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)
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 high[1] < open and high[2] < open)
plotshape(data14,  title= "Hanging Man", color=red, style=shape.arrowdown, text="Hanging\nMan")

plotshape(data15, title= "Dark Cloud Cover", color=red, style=shape.arrowdown, text="Dark\nCloudCover")

Great thanks for this one
No problem. I hope it works well for you.
@TASAVANT, Trend is here simple and nicest algorithm

This works great, thanks a bunch!

I was wondering if it was possible to plot these points based on a daily timeframe regardless of current time frame your in? I would REALLY appreciate it. :]
repo32 PRO TheJoker.
I hope it is useful for you. Not sure if I understand you correctly. I think you are asking if it is possible to show you are in a bearish engulfing (example) day while viewing a 5 minute time frame. In a single day, the one candlestick could go through several patterns, but the only valid pattern is the one at the end of the day. I will think about how to even display something like that on the lower time frames.
Yup -- that's exactly what I mean. Sorry, i'm pretty awful at explaining myself. Either way -- fantastic script, thank you very much for taking your time to create it, and share it. :]
Great indicator - nice work... I'm not getting any shooting stars rendering on my chart. I've definitely found a bar that has a bull previous bar, with the current bar opening above that bar, with a top wick 3x that of the body and a bottom wick that is less than the body... but it's not being labelled.

I did change this line so "open >= close" as I felt that the shooting star could actually open at the same price or equal (>=) to the previous bar, rather than just greater than... but that didn't help:

data4=(open < close and open >= close and high - max(open, close) >= abs(open - close) * 3 and min(close, open) - low <= abs(open - close))

What am I missing?
truelifeajf truelifeajf
Also, does a shooting star really need to open above the previous close?

Links from dailyfx, etc indicate a shooting start doesn't have the open above the previous close:
repo32 PRO truelifeajf
Hello truelifeajf, I was able to locate some shooting stars with the code. There are apparently several definitions out there for it. Try replacing the data4 code with this one, to see if this better suits your needs:

plotshape(data4, title= "Shooting Star", color=red, style=shape.arrowdown, text="Shooting\nStar")

You can try adjusting the formulas to your desired result and save it as your own script for inputting into your charts. Good luck.
Really nice job adding great value to the community!
repo32 PRO timwest
Thank you sir. That means a lot.
repo32, this is outstanding!!! I got the series by Stephen Bigalow, who you mentioned. It itself is outstanding work. Now with your script applied to my chart, I can refer back & forth from Bigalow's instructions to the chart. A BIG help. Thank you.
repo32 PRO SumrallBill
Jan, so glad to hear it is working so well for you. This is the one script on all my charts. I personally love seeing the Harami when price is at a support/resistance area. Bigalow is a fantastic chartist. His market wrap up is always enlightening. ///Hopefully the link comes through. You can check his track record for when a turn is coming or confirmed. The above signals were used because of his 12 major signals. Enjoy.
Very nicely done keep up the GREAT CODING...
Thank you for the kind words. I hope to put out some more when things slow down at work.
Really great work! Just a comment - is there a way to hide all the 0.000 after the Candles(0.05) legend? I am new to this script coding so pardon my incomprehension!
repo32 PRO dawarravi
dawarravi, sorry for the long delay in response. Didn't realize you had commented. The way to turn this off (for all your indicators) is to right click in the chart and choose 'properties', next go to 'background' and uncheck 'Indicator Values'. I personally uncheck all of the boxes under the 'background' tab. Hope that helps.
repo32, Great work here. Anyone who is learning & practices candlestick analysis will appreciate the work you've done. Bigalow's videos are helpful as well.
repo32 PRO rmwaddelljr
Thank you. I hope you are able to use it to produce some income. I use mine almost daily.
I would like to add to your code to show rules for some of the candles, e.g.., inverted hammer (colored bars for buy signals), above/below 8ema, etc. Make sense? Not quite sure where to start.
repo32 PRO rmwaddelljr
That is the beauty of TradingView. The code is wide open for you to change to your style. I would start by renaming this script for your own library. Then take a look at some scripts that change barcolors based upon conditions. Chris Moody has quite a few ideas. This one:
CM_Price-Action-Bars-Price Patterns That Work!
would probably do what you want. Start by changing just one thing on your new script. As you get to know the language, you can piece it together pretty quick. Good luck with your project. Pretty fun stuff once you dip your toes in. Rob
How do I send you what I've done? I don't want to publish it yet because it's still not right,
but would like for you to take a look at it.
repo32 PRO rmwaddelljr
Sent you private message. Just reply to it.
Thank you! Very interesting indicator. I was wondering whether you might consider adding one or more filters so that only those patterns satisfying filter conditions are displyed, for example show bullish patterns only when RSXC is below 20 and it is raising. Vice versa for overbought conditions.
repo32 PRO guidoisot
Yes. I am considering it. Just don't have the time to program it in right now. But have several things I will be working on in the near future.
Thanks Repo you're a legend mate. Is there any chance you can enable us to change the colour of the actual labels on the chart?
repo32 PRO DimiAverilla
Dimi, You are correct. Just tried to do it through the dialog box and it only changed the arrow color. If you go into the code and change the color under plotshape, it does work there. Hope that helps. i.e. plotshape(data6, title= "Bearish Harami", color=yellow , style=shape.arrowdown, text="Bearish\nHarami")
Thanks Repo. You're the man!
Excellent work!
repo32 PRO morshedul.sazid
Thank you. Hope it makes you some nice income.
Sorry for asking,let's say I want only the haramis and dojis to show,how do I do it?
repo32 PRO pierre92
No problem in asking. You will need to open up the script. You will see three tabs (Inputs/Style/Source Code) Open the Style Tab. Just uncheck the candlesticks you do not want to see. I am the same way. I love the Haramis and Engulfings. Good luck.
pierre92 repo32
Thanks man.
I was wondering If there is a way that I don't have to go through individual charts and get a pop up or any notification that Engulfings or harami's have appeared in this and this stock. Its probably not related to this code, but was wondering if any one can help. Thanks BTW great work with the code repo.
repo32 PRO nicktrader37
I think I understand what you are asking. Unfortunately, with TradingView, you will have to setup alerts for each stock and each time frame you are looking for. For example, if you are looking for Engulfings on AAPL, you would have to set it up for whatever time frame you are looking for. ie. 5 min, 1 hr, daily, weekly, etc. You can set it up to alert you for a couple of months, before it will expire on its own. I hope that helps. Glad you like the code. Thanks. Rob.
Onde posso encontrar esse script ?
É free? ou Pago?
repo32 PRO evancarv
Free. El guión es en la parte superior de la página, debajo del gráfico . Rob
I want to create a script based on candlestick color. For examle 1=green, 0=red.
I want my script to recognize, for example when the pattern 01101101010 was formed.

It is possible to do this on tradingview charts?
repo32 PRO AlexNimerciag
Yes. Chris Moody has an excellent example of it here:

CM Stochastic POP Method 1 - Jake Bernstein_V1

You can apply the same concept to about any script. I have done it myself with candlesticks, but didn't publish it. Unfortunately, when trying to paste the code here, TradingView does not allow it. Good Luck. Rob
Thank you!
Finally I figured it with this example:
Candlestick Patterns Identified (updated 3/11/15)

It is very simple.
Now I'm happy :)
repo32 PRO AlexNimerciag
Your welcome and good luck.
Hello Repo32
Your chart looks perfect with the candle study.
I have found interesting methods here and it is found to be patent technology in stock marketting
Can you try automtate this for tradingview
Message me for more discussions.
repo32 PRO MarxBabu
I will message you.
repo32 tanx for this!
can you ad alert for this !
repo32 PRO Toite.Katkestus
All the candlesticks can have an alert added to them. Just add the script to your chart, then "add alert". You will change it from the stock symbol to Candles. Then change "crossing" to "greater than". Change the value to ".01". From there, you can change your frequency. I usually put once upon bar close. Good luck.
hello , how to download this one because im new to this ? all thanks
repo32 PRO manoxrx
It is very simple. You already saved it to your favorites. Now right click on your chart and add indicator. Then click on favorites to locate this script.
+1 Reply
lebabe repo32
how can i add this indicator to MT4 or Trading Station
I don't use either of those applications. Someone on this site could probably tell you, if you ask inside one of the chat rooms. Good luck!
lebabe repo32
Thanks Repo, i trade with fxcm broker, so i use trading station platform, what broker do you trade with? and you trade on web (
I use OptionsHouse and Ustocktrade. I don't trade ON TradingView, but you may be able to with FXCM.
lebabe repo32
thanks guys, have a good day
Thank you for this. I am trying to install this but no luck. Should the code be pasted as script, indicator or EA? I would really appreciate if someone writes the simple steps to add this script into my MT4. Thank you in advance.
repo32 PRO reforex
@reforex, Unfortunately, this script is not for MT4.
Hi, would it be possible to add the following patterns to this script?

- Bullish Abandoned Baby
-Bullish Tweezers
-Ladder Bottom
-Bullish Belthold
-Three Starts in the South
-Three Inside Up
-Three Outside Up
repo32 PRO AdamW328
@AdamW328, They could be added. I just don't have the time to do this at the moment. Work has me tied up for next few months.
AdamW328 repo32
@repo32, ok thanks for the reply.
Ideas Scripts Chart
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