JustUncleL

Price Action Doji Harami v0.1 by JustUncleL

This indicator identifies the near Doji candlestick patterns specifically used with the Heikin Ashi candle charts. These candle patterns indicate a potential trend reversal.

The description patterns identified are:
- Bearish Doji (aka Bearish Harami) (Red Highlight above Bar):
Three(3) large body Bull (green) candles followed by a small or no body candle
with wicks top and bottom that are at least 60% of candle.

- Bullish Doji (aka Bullish Harami) (Green Highlight below Bar):
Three(3) large body Bear (red) candles followed by a small or no body candle
with wicks top and bottom that are at least 60% of candle.

Can optionally specify large candle, in pips, of previous candles to Doji, default is 1 pip.
If you set this to zero then it will have no candle size consideration.

You can also specify % of candle the wicks are, the default is 60%.
Remove from Favorite Scripts Add to Favorite Scripts
//@version=2
//
// Name: Price Action Doji Harami v0.1 by JustUncleL
// By: JustUncleL
// Date: 4-Sep-2016
// Version: v0.1
//
// Description:
//   Identifies the Doji candlestick patterns as used with the
//   Heikin Ashi candles. These candles indicates a potential trend reversal.
//   The patterns identified are:
//   - Bearish Doji (aka Bearish Harami) (Red Highlight above Bar): 
//       Three(3) large body Bull (green) candles followed by a small or no body candle 
//       with wicks top and bottom that are at least 60% of candle.
//   - Bullish Doji (aka Bullish Harami) (Green Highlight below Bar): 
//       Three(3) large body Bear (red) candles followed by a small or no body candle
//       with wicks top and bottom that are at least 60% of candle.
//
//   You can optionally specify large candle in pips previous to Doji, default is 1 pip.
//   If you set this to zero then it will have no candle size consideration.
//
// references:
//  - Price Action Candles v0.3 by JustUncleL
//  
// modifications:
//  0.1 Original Beta version.
//
study(title = "Price Action Doji Harami v0.1 by JustUncleL", shorttitle="PACDOJI v0.1 by JustUncleL", overlay = true)
//

pctDw = input(60,minval=0,maxval=90,title="Doji, Min % of Range of Candle for Wicks")
pipMin= input(1,minval=0,title="Doji, Previous Candle Min Pip Body Size")
sname=input(true,title="Show Price Action Bar Names")
cbar = input(false,title="Colour Price Action Bars")
setalm = input(false, title="Generate Alert for Selected PA Candles")

//
pip = syminfo.mintick
range = high - low

// Calculate Doji/Harami Candles
pctCDw = (pctDw/2) * 0.01
pctCDb = (100-pctDw) * 0.01
dojiBull=(open[1]>close[1] and (open[1]-close[1])>pipMin*pip and open[2]>close[2] and (open[2]-close[2])>pipMin*pip and open[3]>close[3] and (open[3]-close[3])>pipMin*pip) 
  and (open[1] >= max(close,open) and close[1]<=min(close,open)) 
  and (abs(close-open)/range<pctCDb and (high-max(close,open))>(pctCDw*range) and (min(close,open)-low)>(pctCDw*range))? 1 : 0
dojiBear=(open[1]<close[1] and (close[1]-open[1])>pipMin*pip and open[2]<close[2] and (close[2]-open[2])>pipMin*pip and open[3]<close[3] and (close[3]-open[3])>pipMin*pip) 
  and (close[1] >= max(close,open) and open[1]<=min(close,open)) 
  and (abs(close-open)/range<pctCDb and (high-max(close,open))>(pctCDw*range) and (min(close,open)-low)>(pctCDw*range))? 1 : 0
//
plotshape(dojiBear and sname?high:na,title="Bearish Doji",text='Bearish\nDoji',color=red, style=shape.arrowdown,location=location.abovebar)
plotshape(dojiBear and cbar?max(open,close):na,title="Bear Colour Doji",color=red, style=shape.circle,location=location.absolute,size=size.normal)
//
plotshape(dojiBull and sname?high:na,title="Bullish Doji",text='Bullish\nDoji',color=green, style=shape.arrowup,location=location.belowbar)
plotshape(dojiBull and cbar?max(open,close):na,title="Bull Colour Doji",color=green, style=shape.circle,location=location.absolute,size=size.normal)

bcolor = dojiBull ? 1 : dojiBear? 2 : 0
baralert = setalm and bcolor>0
alertcondition(baralert,title="PACDOJI Alert",message="PACDOJI Alert")

//
plotshape(na(baralert[1])?na:baralert[1], transp=0,style=shape.circle,location=location.bottom, offset=-1,title="Bar Alert Confirmed", 
  color=bcolor[1]==1 ? green : bcolor[1]==2? red : na)

//EOF
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