repo32

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

data15=((close[1]>open[1])and(((close[1]+open[1])/2)>close)and(open>close)and(open>close[1])and(close>open[1])and((open-close)/(.001+(high-low))>0.6))
plotshape(data15, title= "Dark Cloud Cover", color=red, style=shape.arrowdown, text="Dark\nCloudCover")


TASAVANT
2 years ago
Great thanks for this one
Reply
repo32 PRO TASAVANT
2 years ago
No problem. I hope it works well for you.
Reply
MarxBabu TASAVANT
2 months ago
@TASAVANT, Trend is here simple and nicest algorithm
SUPER SUPERTREND THREE LINE PROFIT STRATEGY

Reply
TheJoker.
2 years ago
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. :]
Reply
repo32 PRO TheJoker.
2 years ago
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.
Reply
TheJoker. repo32
2 years ago
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. :]
Reply
truelifeajf
2 years ago
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?
Reply
truelifeajf truelifeajf
2 years ago
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:

http://www.onlinetradingconcepts.com/TechnicalAnalysis/Candlesticks/ShootingStar.html
http://www.dailyfx.com/forex/technical/candlesticks/title/2012/11/06/LEARN_FOREX_How_to_Trade_Shooting_Star_Candle_Patterns.html
Reply
repo32 PRO truelifeajf
2 years ago
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:

data4=(((high-low)>4*(open-close))and((high-close)/(.001+high-low)>=0.75)and((high-open)/(.001+high-low)>=0.75))
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.
Reply
timwest PRO
2 years ago
Really nice job adding great value to the community!
Reply
repo32 PRO timwest
2 years ago
Thank you sir. That means a lot.
Reply
SumrallBill PRO
2 years ago
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.
Reply
repo32 PRO SumrallBill
2 years ago
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. http://candlestickforum.com/PPF/Parameters/11_6643_/candlestick.asp ///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.
Reply
l330n PRO
2 years ago
Very nicely done keep up the GREAT CODING...
Reply
repo32 PRO l330n
2 years ago
Thank you for the kind words. I hope to put out some more when things slow down at work.
Reply
dawarravi
2 years ago
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!
Reply
repo32 PRO dawarravi
2 years ago
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.
Reply
rmwaddelljr
2 years ago
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.
Thanks.
Reply
repo32 PRO rmwaddelljr
2 years ago
Thank you. I hope you are able to use it to produce some income. I use mine almost daily.
Reply
rmwaddelljr repo32
2 years ago
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.
Reply
repo32 PRO rmwaddelljr
2 years ago
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
Reply
rmwaddelljr repo32
2 years ago
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.
Reply
repo32 PRO rmwaddelljr
2 years ago
Sent you private message. Just reply to it.
Reply
guidoisot
2 years ago
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.
Reply
repo32 PRO guidoisot
2 years ago
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.
Reply
DimiAverilla
2 years ago
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?
snapshot
Reply
repo32 PRO DimiAverilla
2 years ago
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")
Reply
DimiAverilla repo32
2 years ago
Thanks Repo. You're the man!
Reply
Excellent work!
Reply
repo32 PRO morshedul.sazid
a year ago
Thank you. Hope it makes you some nice income.
Reply
pierre92
a year ago
Sorry for asking,let's say I want only the haramis and dojis to show,how do I do it?
Reply
repo32 PRO pierre92
a year ago
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.
Reply
pierre92 repo32
a year ago
Thanks man.
Reply
nicktrader37
8 months ago
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.
Reply
repo32 PRO nicktrader37
8 months ago
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.
Reply
evancarv
8 months ago
Onde posso encontrar esse script ?
Reply
evancarv
8 months ago
É free? ou Pago?
Reply
repo32 PRO evancarv
8 months ago
Free. El guión es en la parte superior de la página, debajo del gráfico . Rob
Reply
AlexNimerciag
8 months ago
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?
Reply
repo32 PRO AlexNimerciag
8 months ago
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
Reply
AlexNimerciag repo32
8 months ago
Thank you!
Finally I figured it with this example:
Candlestick Patterns Identified (updated 3/11/15)

It is very simple.
Now I'm happy :)
Reply
repo32 PRO AlexNimerciag
8 months ago
Your welcome and good luck.
Reply
MarxBabu
7 months ago
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
http://www.forexfactory.com/attachment.php?s=153104c0aa8896a22026c92eaab968a7&attachmentid=1447280&d=1402652572
Message me for more discussions.
Reply
repo32 PRO MarxBabu
7 months ago
I will message you.
Reply
Toite.Katkestus
6 months ago
repo32 tanx for this!
can you ad alert for this !
Reply
repo32 PRO Toite.Katkestus
6 months ago
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.
Reply
manoxrx
4 months ago
hello , how to download this one because im new to this ? all thanks
Reply
repo32 PRO manoxrx
4 months ago
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.
Reply
lebabe repo32
4 months ago
how can i add this indicator to MT4 or Trading Station
Reply
repo32 PRO lebabe
4 months ago
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!
Reply
lebabe repo32
4 months ago
Thanks Repo, i trade with fxcm broker, so i use trading station platform, what broker do you trade with? and you trade on web (tradingview.com)?
Reply
repo32 PRO lebabe
4 months ago
I use OptionsHouse and Ustocktrade. I don't trade ON TradingView, but you may be able to with FXCM.
Reply
lebabe repo32
4 months ago
thanks guys, have a good day
Reply
reforex
3 months ago
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.
Reply
repo32 PRO reforex
3 months ago
@reforex, Unfortunately, this script is not for MT4.
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener 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