JustUncleL

Price Action Doji Harami v0.2 by JustUncleL

This is an updated and final version of this indicator. This version distinguishes between the true Harami and the other Doji candlestick patterns as used with the Heikin Ashi candle charts. These candle patterns indicate a potential trend reversal or pullback.
The patterns identified are:
- Bearish Harami (Red Highlight above Bar):
One to three (default 3) large body Bull (green) candles followed by a small (red)
or no body candle (less than 0.5pip) with wicks top and bottom that are at least 60% of candle.
- Bullish Harami (Green Highlight below Bar):
One to three (default 3) large body Bear (red) candles followed by a small (green)
or no body candle (less than 0.5pip) with wicks top and bottom that are at least 60% of candle.
- Bearish Doji (Fuchsia Highlight above Bar):
One to three (default 3) large body Bull (green) candles followed by a small (green)
with wicks top and bottom that are at least 60% of candle.
- Bullish Doji (Aqua Highlight below Bar):
One to three (default 3) large body Bear (red) candles followed by a small (red)
with wicks top and bottom that are at least 60% of candle.

You can optionally specify how large the candles prior to Harami/Doji are in pips, default is 0 pip.
If you set this to zero then it will have no candle size consideration. You can also specify how many look back candles (1-3) are used in Harami/Doji calculations (default 3).

Included option to perform Calculations purely on Heikin Ashi candles, this helps when you want to see the HA Doji/Harami bars with the normal candle stick chart.

Also can optionally set an alert condition for when Harami/Doji found, this also displays a circle on the bottom of the screen when alert is triggered.
즐겨찾기 스크립트에서 빼기 즐겨찾기 스크립트에 넣기
//@version=2
//
// Name: Price Action Doji Harami v0.2 by JustUncleL
// By: JustUncleL
// Date: 4-Sep-2016
// Version: v0.2
//
// Description:
//   Identifies the Harami + Doji candlestick patterns as used with the
//   Heikin Ashi candles. These candles indicates a potential trend reversal.
//   The patterns identified are:
//   - Bearish Harami (Red Highlight above Bar): 
//       Three(3) large body Bull (green) candles followed by a small (red) 
//       or no body candle with wicks top and bottom that are at least 60% of candle.
//   - Bullish Harami (Green Highlight below Bar): 
//       Three(3) large body Bear (red) candles followed by a small (green) 
//       or no body candle with wicks top and bottom that are at least 60% of candle.
//   - Bearish Doji (Fuchsia Highlight above Bar): 
//       Three(3) large body Bull (green) candles followed by a small (green) 
//       with wicks top and bottom that are at least 60% of candle.
//   - Bullish Doji (Aqua Highlight below Bar): 
//       Three(3) large body Bear (red) candles followed by a small (red)
//       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.
//   Included option to perform Calculations purely on Heikin Ashi candles, this helps
//   when you want to still see the HA Doji/Harami with the normal candle chart.
//
// references:
//  - Price Action Candles v0.3 by JustUncleL
//  
// modifications:
//  0.2 Modified Doji caculations to seperate true Harami patterns. 
//      Included option to show/alert all Doji's patterns.
//      Included option to Calculate Doji/Harami patterns only on Heikin Ashi candles.
//      Included option to specify how many candles (1 to 3) to look back to test Doji/Harami pattern.
//  0.1 Original Beta version.
//
study(title = "Price Action Doji Harami v0.2 by JustUncleL", shorttitle="PACDOJI v0.2 by JustUncleL", overlay = true, max_bars_back=3000)
//

pctDw = input(60,minval=0,maxval=90,title="Doji, Min % of Range of Candle for Wicks")
pipMin= input(0,minval=0,title="Doji, Previous Candle Min Pip Body Size")
sname=input(true,title="Show Price Action Bar Names")
cbar = input(false,title="Highlight Harami & Doji Bars")
sHm    = input(false,title="Show Only Harami Style Doji's")
setalm = input(true, title="Generate Alert for Harami & Doji Bars")
uha   =input(true, title="Use Heikin Ashi Candles for Calculations")
bars = input(3,minval=1,maxval=3,step=1,type=integer, title="Doji, Number of Lookback Bars")
//
// Use only Heikinashi Candles for all calculations
srcclose = uha ? security(heikinashi(tickerid), period, close) : close
srcopen = uha ? security(heikinashi(tickerid), period, open) : open
srchigh = uha ? security(heikinashi(tickerid), period, high) : high
srclow = uha ?security(heikinashi(tickerid), period, low) : low

//
pip = syminfo.mintick
range = srchigh - srclow


// Calculate Doji/Harami Candles
pctCDw = (pctDw/2) * 0.01
pctCDb = (100-pctDw) * 0.01

//Lookback Candles for bulls or bears
lbBull = bars==1? srcopen[1]>srcclose[1]: bars==2? (srcopen[1]>srcclose[1] and srcopen[2]>srcclose[2]): bars==3?(srcopen[1]>srcclose[1] and srcopen[2]>srcclose[2] and srcopen[3]>srcclose[3]):false
lbBear = bars==1? srcopen[1]<srcclose[1]: bars==2? (srcopen[1]<srcclose[1] and srcopen[2]<srcclose[2]): bars==3?(srcopen[1]<srcclose[1] and srcopen[2]<srcclose[2] and srcopen[3]<srcclose[3]):false

//Lookback Candle Size only if mininum size is > 0
lbSize = pipMin==0? true : bars==1 ? (abs(srcopen[1]-srcclose[1])>pipMin*pip) :
  bars==2 ? (abs(srcopen[1]-srcclose[1])>pipMin*pip and abs(srcopen[2]-srcclose[2])>pipMin*pip) :
  bars==3 ? (abs(srcopen[1]-srcclose[1])>pipMin*pip and abs(srcopen[2]-srcclose[2])>pipMin*pip and abs(srcopen[3]-srcclose[3])>pipMin*pip) :
  false

dojiBu = (srcopen[1] >= max(srcclose,srcopen) and srcclose[1]<=min(srcclose,srcopen)) and lbSize and
  (abs(srcclose-srcopen)<range*pctCDb and (srchigh-max(srcclose,srcopen))>(pctCDw*range) and (min(srcclose,srcopen)-srclow)>(pctCDw*range))? 1 : 0

dojiBe = (srcclose[1] >= max(srcclose,srcopen) and srcopen[1]<=min(srcclose,srcopen)) and lbSize and
  (abs(srcclose-srcopen)<range*pctCDb and (srchigh-max(srcclose,srcopen))>(pctCDw*range) and (min(srcclose,srcopen)-srclow)>(pctCDw*range))? 1 : 0
  
haramiBull = (srcopen<=srcclose or (max(srcclose,srcopen)-min(srcclose,srcopen))<pip*0.5) and lbBull and dojiBu
haramiBear = (srcopen>=srcclose or (max(srcclose,srcopen)-min(srcclose,srcopen))<pip*0.5) and lbBear and dojiBe

dojiBull = not sHm and not haramiBull and not haramiBear and lbBull and dojiBu
dojiBear = not sHm and not haramiBull and not haramiBear and lbBear and dojiBe

//
plotshape(haramiBear and sname?srchigh:na,title="Bearish Harami",text='Bearish\nHarami',color=red, style=shape.arrowdown,location=location.abovebar)
plotshape(haramiBear and cbar?max(srcopen,srcclose):na,title="Bear Colour Harami",color=red, style=shape.circle,location=location.absolute,size=size.normal)
//
plotshape(haramiBull and sname?srclow:na,title="Bullish Harami",text='Bullish\nHarami',color=green, style=shape.arrowup,location=location.belowbar)
plotshape(haramiBull and cbar?max(srcopen,srcclose):na,title="Bull Colour Harami",color=green, style=shape.circle,location=location.absolute,size=size.normal)
//
plotshape(dojiBear and sname?srchigh:na,title="Bearish Doji",text='Bearish\nDoji',color=fuchsia, style=shape.arrowdown,location=location.abovebar)
plotshape(dojiBear and cbar?max(srcopen,srcclose):na,title="Bear Colour Doji",color=fuchsia, style=shape.circle,location=location.absolute,size=size.normal)
//
plotshape(dojiBull and sname?srclow:na,title="Bullish Doji",text='Bullish\nDoji',color=aqua, style=shape.arrowup,location=location.belowbar)
plotshape(dojiBull and cbar?max(srcopen,srcclose):na,title="Bull Colour Doji",color=aqua, style=shape.circle,location=location.absolute,size=size.normal)

// Only Alert harami Doji's
bcolor = haramiBull ? 1 : haramiBear ? 2 : dojiBull ? 3 : dojiBear ? 4 : 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 : bcolor[1]==3? aqua : bcolor[1]==4? fuchsia : na)

//EOF
JustUncleL
nice, do you make anything for Metatrader 4 ?
응답
JustUncleL cobra5000
@cobra5000, No, I do not code for Metatrader.
응답
ok!!!
응답
Good job!
응답
pls give permisson to use it sir
응답
JustUncleL Kumaran1964
@Kumaran1964, Not required, this is open unsecured script.
응답
jason0027 JustUncleL
@JustUncleL, can i use this indicator on mt4?
응답
JustUncleL jason0027
@jason0027, Pinescript is not compatible with MT4.
응답
cobra5000 JustUncleL
@JustUncleL, my question is answered. there would have to be a conversion over to mt4..
응답
Thanks.
Very interestingly. I will try.
응답
홈으로 스탁 스크리너 포렉스 스크리너 크립토 스크리너 이코노믹 캘린더 사용안내 차트 특징 프라이싱 하우스룰(내부규정) 모더레이터 웹사이트 & 브로커 솔루션 위젯 차팅 솔루션 도움 받기 기능 개발/개선 요청 블로그 & 뉴스 잦은물음 위키 트위터
프로화일 프로화일설정 계정 및 빌링 트레이딩뷰 코인 나의 서포트 티켓 도움 받기 공개아이디어 팔로어 팔로잉 비밀메시지 채팅 로그아웃