Heikin-Ashi Candle in combination with “for example” Stochastic Indicator. The code of the doji on Heikin-Ashi candles gives three possibilities.
- A doji to go up (Green)
- A doji to go down (Red)
- A doji undecided, then we use a second indicator for the direction (WhitCode
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
//Zigo 24/07/2020 IF BarIndex = 0 THEN XClose = TotalPrice XOpen = (Open + Close) / 2 ELSE XClose = TotalPrice XOpen = (XOpen[1] + Xclose[1]) / 2 ENDIF if xclose>xopen then DRAWCANDLE(XOpen,high,low,XClose) COLOURED(0,100,170,125) elsif xclose<xopen then DRAWCANDLE(XOpen,high,low,XClose) COLOURED(250,150,0,125) endif Ho=high L=Low HAR=(xopen -xclose) R=Ho-L if ABS(xopen- xclose)<= 0.15*R then if har >0 and (open < close)then DRAWTEXT("H-A Doji Up", barindex, low-0.75*AverageTrueRange[14](close), dialog,standard, 15)coloured(0,250,0,255) DRAWARROWUP(barindex, low-0.125*AverageTrueRange[14](close))coloured(0,250,0,255) elsif har <0 and (open>close) then DRAWTEXT("H-A Doji Dn", barindex, High+0.75*AverageTrueRange[14](close), dialog,standard, 15)coloured(255,150,0,255) DRAWARROWDOWN(barindex, High +0.125*AverageTrueRange[14](close))coloured(255,150,0,255) else DRAWARROW(barindex, close) endif endif return |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :
Filename : download the ITF files
How to import ITF files into ProRealTime platform?
PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Hi I have been trying to test a strategy to buy and sell based on the indicator cross overs. It returns a syntax error saying following variables are not defined: indicator 1, indicator 2, indicator 3 and indicator 4. Also in the indicator itself in the price setting dialogue box, there is an error sign in front of p and consigne. Please could someone help.
I’am sorry that I answer so late, but the code seems to be working perfect. I use the indicator only for trend changing. Often, not always, there is a change in trend.