JustUncleL

Price Action Candles v0.2 by JustUncleL

Second release of this requested script. This version includes candle colouring as per "theforexguy" specifications, also redefined PinBar/Hammers and Outside Bars to match user request. Please find below a description of each candle pattern found by this script:
The patterns identified are:
- Dark Cloud Cover (Yellow Highlight Bar):
Large body bull green candle followed by large body
bear red candle that covers the upper bull candle and closes in the
lower 50% of bull body.
- Piecing Line (Aqua Highlight Bar):
Large body bear red candle followed by large body
bull green candle that covers the lower bear candle and closes in the
upper 50% of bear body.
- Doji (aka spinning top) (Fuchsia Highlight Bar):
A small or no body candle with wicks top and
bottom that are at least 30% of candle.
- Bullish Engulfing (Aqua Highlight Bar) (Aqua Highlight Bar):
A bear red candle followed by a larger bull green candle
whose body covers the bear candle including the upper wick.
- Bearish Engulfing (Yellow Highlight Bar):
A bull green candle followed by a larger bear red candle
whose body covers the bull candle including the lower wick.
- Bullish Outside Bar (Aqua Highlight Bar):
A small inner red candle followed by a large outer green candle.
The outer candle covers the whole inner candle (wick to wick)
- Bearish Outside Bar (Yellow Highlight Bar):
A small inner green candle followed by a large outer red candle.
The outer candle covers the whole inner candle (wick to wick)
- Inside Bar (Orange Highlight Bar):
A large inner candle followed by a small outer candle.
The inner candle covers the whole outer candle (wick to wick)
- Upper Shadow Pin Bar (aka bull rejection) (Aqua Highlight Bar):
a small body bear (red) candle followed which has a large upper wick
and a small lower wick.
- Lower Shadow Pin Bar (aka bear rejection) (Yellow Highlight Bar):
a small body bull (green) candle followed which has a large lower wick
and a small upper wick.
- Inverted Hammer (aka shooting star) (Yellow Highlight Bar):
a small body bear (green) candle followed which has a large upper wick
and a small lower wick.
- Hammer (aka hanging man) (Aqua Highlight Bar) :
a small body bull (red) candle followed which has a large lower wick
and a small upper wick.

The script settings allow you to enable/disable bar colouring, enable/disable bar naming, enable what candle patterns you want displayed and what % of candle the long wick is for PinBars/Hammers (default 70%).
Remove from Favorite Scripts Add to Favorite Scripts
//@version2
//
// Name: Price Action Candlesticks v0.1 by JustUncleL
// By: JustUncleL
// Date: 16-Aug-2016
// Version: v0.1
//
// Description:
//   Identifies the candlestick patterns as used in
//   "Price Action Battle Station by theforexguy". All the identification 
//   of PA candles is dissabled by default.
//   The patterns identified are:
//   - Dark Cloud Cover (Yellow Highlight Bar): 
//       Large body bull green candle followed by large body
//       bear red candle that covers the upper bull candle and closes in the
//       lower 50% of bull body.
//   - Piecing Line (Aqua Highlight Bar): 
//       Large body bear red candle followed by large body
//       bull green candle that covers the lower bear candle and closes in the
//       upper 50% of bear body.
//   - Doji (aka spinning top) (Fuchsia Highlight Bar): 
//       A small or no body candle with wicks top and 
//       bottom that are at least 30% of candle.
//   - Bullish Engulfing (Aqua Highlight Bar) (Aqua Highlight Bar): 
//       A bear red candle followed by a larger bull green candle
//       whose body covers the bear candle including the upper wick.
//   - Bearish Engulfing (Yellow Highlight Bar): 
//       A bull green candle followed by a larger bear red candle
//       whose body covers the bull candle including the lower wick.
//   - Bullish Outside Bar (Aqua Highlight Bar): 
//       A small inner red candle followed by a large outer green candle. 
//       The outer candle covers the whole inner candle (wick to wick)
//   - Bearish Outside Bar (Yellow Highlight Bar): 
//       A small inner green candle followed by a large outer red candle. 
//       The outer candle covers the whole inner candle (wick to wick)
//   - Inside Bar (Orange Highlight Bar): 
//       A large inner candle followed by a small outer candle. 
//       The inner candle covers the whole outer candle (wick to wick)
//   - Upper Shadow Pin Bar (aka bull rejection) (Aqua Highlight Bar): 
//       a small body bear (red) candle followed which has a large upper wick
//       and a small lower wick.
//   - Lower Shadow Pin Bar (aka bear rejection) (Yellow Highlight Bar): 
//       a small body bull (green) candle followed which has a large lower wick
//       and a small upper wick.
//   - Inverted Hammer (aka shooting star) (Yellow Highlight Bar): 
//       a small body bear (green) candle followed which has a large upper wick
//       and a small lower wick.
//   - Hammer (aka hanging man) (Aqua Highlight Bar) : 
//       a small body bull (red) candle followed which has a large lower wick
//       and a small upper wick.
//
//
// references:
//  - Inside/Outside Bars and Pin Barsome calculations based on
//        "CM_Price-Action-Patterns Price Bars That Work! by chrismoody"
//  - Other candles, although they all needed correcting, based on
//        "All Candlestick Pattern identifier by alona.gz"
//
// modifications:
//  0.2 Added Hammer and inverted hammer bars.
//      Added PA Bar Colouring as per "Price Action Battle Station by theforexguy"
//  0.1 Original Beta version.
//
study(title = "Price Action Candles v0.2 by JustUncleL", overlay = true)
//

sdc = input(false,title="Show Dark Cloud Cover")
spl = input(false,title="Show Piecing Line")
sdj = input(false,title="Show Doji")
sble = input(false,title="Show Bullish Engulfing")
sbre = input(false,title="Show Bearish Engulfing")
sosb = input(false,title="Show Outside Bars")
sisb = input(false,title="Show Inside Bars")
supp = input(false,title="Show Up Reject Green Pin Bar")
sdnp = input(false,title="Show Down Reject Red Pin Bar")
shmr = input(false,title="Show Red Hammer")
sihmr = input(false,title="Show Green Inverted Hammer")
pctP = input(70, minval=1, maxval=99, title="PinBar/Hammer, % of Range of Candle the Long Wick Has To Be")
sname=input(true,title="Show Price Action Bar Names")
cbar = input(false,title="Colour Price Action Bars")

//
range = high - low

darkCloud=sdc and (close[1]>open[1] and abs(close[1]-open[1])/range[1]>=0.7 and close<open and abs(close-open)/range>=0.7 and open>=close[1] and close>open[1] and close<((open[1]+close[1])/2))
plotshape(darkCloud and sname,title="Dark Cloud Cover",text='DarkCloud\nCover',color=red, style=shape.arrowdown,location=location.abovebar)

piecingLine=spl and (close[1]<open[1] and abs(open[1]-close[1])/range[1]>=0.7 and close>open and abs(close-open)/range>=0.7 and open<=close[1] and close<open[1] and close>((open[1]+close[1])/2))
plotshape(piecingLine and sname,title="Piercieng Line",text="Piercing\nLine",color=green, style=shape.arrowup,location=location.belowbar)

doji=sdj and (abs(close-open)/range<0.1 and (high-max(close,open))>(0.3*range) and (min(close,open)-low)>(0.3*range))
plotshape(doji and sname?high:na,title="Doji",text='Doji',color=fuchsia, style=shape.arrowup,location=location.belowbar)
plotshape(doji and cbar?max(open,close):na,title="Colour Doji",color=fuchsia, style=shape.circle,location=location.absolute,size=size.normal)

bullishEngulf=sble and (close[1]<open[1] and close>open and close>=high[1] and open<=close[1])
plotshape(bullishEngulf and sname,title="Bullish Engulfing",text='Bullish\nEngulfing',color=green, style=shape.arrowup,location=location.belowbar)

bearishEngulf=sbre and (close[1]>open[1] and close<open and close<=low[1] and open>=close[1])
plotshape(bearishEngulf and sname,title="Bearish Engulfing",text='Bearish\nEngulfing',color=red, style=shape.arrowdown,location=location.abovebar)

//Inside Bars
insideBar = sisb and (high < high[1] and low > low[1])
outsideBarBu= sosb and open[1]>close[1] and open<close and (high > high[1] and low < low[1])
outsideBarBe= sosb and open[1]<close[1] and open>close and (high > high[1] and low < low[1])

//Inside and Outside Bars
plotshape(insideBar and sname,title="Inside Bar",text="Inside\nBar",color=green, style=shape.arrowup,location=location.belowbar)
plotshape(outsideBarBe and sname,title="Bearish Outside Bar",text="Bearish\nOutsideBar",color=red, style=shape.arrowdown,location=location.abovebar)
plotshape(outsideBarBu and sname,title="Bullish Outside Bar",text="Bullish\nOutsideBar",color=green, style=shape.arrowup,location=location.belowbar)

//PBar Percentages
pctCp = pctP * .01

///PinBars Long Upper Shadow represent selling pressure
pBarUp = supp and (open>close and open < (high - (range * pctCp)) and close < (high - (range * pctCp)))
///PinBars with Long Lower Shadow represent buying pressure
pBarDn = sdnp and (open<close and open > (low + (range * pctCp)) and close > (low + (range * pctCp)))

plotshape(pBarUp and sname,title="Up Rejection Pin Bar",text='Up Reject\nPinBar',color=red, style=shape.arrowdown,location=location.abovebar)
plotshape(pBarDn and sname,title="Down Rejection Pin Bar",text='Down Reject\nPinBar',color=green, style=shape.arrowup,location=location.belowbar)

///PinBars Long Upper Shadow represent selling pressure
ihmr  = shmr and (open<close and open < (high - (range * pctCp)) and close < (high - (range * pctCp)))
///PinBars with Long Lower Shadow represent buying pressure
hmr = sihmr and (open>close and open > (low + (range * pctCp)) and close > (low + (range * pctCp)))

plotshape(ihmr and sname,title="Inverted Hammer",text='Inverted\nHammer',color=red, style=shape.arrowdown,location=location.abovebar)
plotshape(hmr and sname,title="Hammer",text='Hammer',color=green, style=shape.arrowup,location=location.belowbar)

bcolor = insideBar? orange : (ihmr or pBarUp or bearishEngulf or darkCloud or outsideBarBe)? yellow: (hmr or pBarDn or bullishEngulf or piecingLine or outsideBarBu)? aqua : na
barcolor(cbar?bcolor:na)
//EOF
jesusislordand2u
3 months ago
i like this you candles stick recognition pattern.but, is there a way where you can add alert?
Reply
JustUncleL PRO jesusislordand2u
3 months ago
This indicator was created by a specific request from another TradeView user, but he did not request any alert. If you want an alert added I will need the alert criteria for it.
+1 Reply
jesusislordand2u
3 months ago
am a binary option trader.it's gonna help me when doji appears.thank you
Reply
JustUncleL PRO jesusislordand2u
3 months ago
I can make an alert for the Doji, any filtering requirements or what is the strategy? For example maybe needs to above EMA(20).
Reply
Hi! Apologies if this is a little off topic, but I can see you've got quite a bit of experience here. What would be a good place for a beginner to look for a chart? I'm mostly swing trading in the US stock market and ETFs. Thanks for any advice :)
Reply
JustUncleL PRO Jamessuperfun
3 months ago
My experience is only in straight Binary Options trading. That is why you see my charts and comments are for Binary Options. My favourite source of free chart set ups and tools is at http://www.forexstrategiesresources.com/ , they are MT4 charts but a lot of my Tradeview chart ideas start from a set up there (some are straight conversions). Also within TradeView forum there are many strong charts, however, I particularly like and follow charts/scripts by ChrisMoody and Vdubus who are very experienced traders.
Reply
MTRGroup PRO
2 months ago
When I apply it the only thing that shows up are the values but not the descriptions. How does this get applied?
Reply
fbatistat PRO
a month ago
@JustUncleL Thanks very much for this indicator. I tried to code an "alertcondition" statement to your indicador, regretfully it didn't do the work. Is it possible for you to enable two alert conditions for the criteria please:
a) pin bars
b) hammers

I will very much appreciate it.
Reply
JustUncleL PRO fbatistat
a month ago
This indicator does not incorporate an "alertcondition" it was not required by the original requester. I can release a new version that alerts on whatever bar pattern you pick.
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 Billing Sign Out