Heikin Ashi candlestick body and moving average condition
Forums › ProRealTime English forum › ProOrder support › Heikin Ashi candlestick body and moving average condition
- This topic has 23 replies, 3 voices, and was last updated 6 years ago by Nicolas.
Tagged: heikin ashi
-
-
09/17/2018 at 4:36 PM #80715
Hello Everyone!
I hope you are well! Once more I’d like to thanks all the participants that makes this website so useful…!
I am currently blocked, I’d like to make a condition that allows me to sell, for example, if the previous Heinkin Ashi candle was under the moving average 30
Does someone knows or has a clue? I can’t find the solution… @Nicolas?
Thanks! 😀
09/18/2018 at 7:59 AM #80734There are so many Heikin Ashi codes around that I think you haven’t search enough 🙂
Anyway, here is an example about looking for an heikin ashi candlestick below a moving average:
123xClose = (Open+High+Low+Close)/4test = xClose crosses under average[30]Close of an Heikin Ashi candle is the same as “totalprice”.
09/18/2018 at 11:02 AM #80753Thank you @Nicolas!
Yes, I’ve seen some but none of them suits what I’m looking for.
In fact, I don’t understand why but when I implement such a strategy it does not take all the possible entries but only some of them and I don’t understand why
Hull and previous candle12345678xClose = (Open+Close)/2xCloseb = (Open[1]+Close[1])/2test = open crossover average[30]IF test AND xClose>xCloseb THENBUY 1 CONTRACT AT MARKETENDIFDo you have an idea regarding this?
THANKS!!! 😀
09/18/2018 at 11:07 AM #80754Everytime you add a leading “@” to a nickname that user receives an email + he receives a further, duplicate, email because he subscribed (just answering) to a topic. So, please don’t abuse “@”!
09/18/2018 at 11:08 AM #8075509/18/2018 at 1:00 PM #80766For example, with the picture enclosed we can see that a green Heikin Ashi candle 1 crosses the blue line (MM30) and the following candle (2) is bigger than the previous one (slightly).
I’d like to write a code that allows me to buy on such conditions but I can’t manage why…
Can you help? 🙂
09/18/2018 at 1:22 PM #80769Try this: (not tested)
12345678910111213DEFPARAM CumulateOrders = false//Heikin-AshixClose = (Open+High+Low+Close)/4if(barindex>2) thenxOpen = (xOpen[1] + xClose[1])/2endifGreen = xClose>xOpenharange = abs(xclose-xopen)macross = xclose crosses over average[30]if green[1] and macross[1] and green and harange>harange[1] thenbuy at marketendifFor a better and complete understanding of how to use variables and their past values, I suggest to watch the ProRealTime programming training videos.
09/18/2018 at 8:42 PM #8080409/18/2018 at 9:25 PM #8081409/18/2018 at 9:35 PM #8081509/18/2018 at 9:36 PM #8081609/18/2018 at 9:39 PM #8081712345678910111213141516171819DEFPARAM CumulateOrders = false//Heikin-AshiPeriod=30inner = 2*weightedaverage[ round( Period/2 ) ](close)-weightedaverage[Period](close)MMHULL=weightedaverage[ round( sqrt(Period) ) ]( inner )xClose = (Open+High+Low+Close)/4if(barindex>2) thenxOpen = (xOpen[1] + xClose[1])/2endifGreen = xClose>xOpenharange = abs(xclose-xopen)macross = xclose crosses over MMHULLif green[1] and macross[1] and green and harange>harange[1] thenbuy at marketendifSomething like this would work?
09/19/2018 at 10:04 AM #8085012345678910111213141516171819DEFPARAM CumulateOrders = false//Heikin-AshiPeriod=30inner = 2*weightedaverage[ round( Period/2 ) ](close)-weightedaverage[Period](close)MMHULL=weightedaverage[ round( sqrt(Period) ) ]( inner )xClose = (Open+Close)/2if(barindex>2) thenxOpen = (xOpen[1] + xClose[1])/2endifGreen = xClose>xOpenharange = abs(xclose-xopen)macross = xclose crosses over MMHULLif green[1] and macross[1] and green and harange>harange[1] thenbuy at marketendifI slightly modified it. What do you think about it? Is it the right way to implement the Hull 30?
Thanks
09/19/2018 at 12:41 PM #80868Yes but in this case you are calculating the Hull moving average on the real Close, not with the Heikin Ashi candlestick one.
Here is the modified code:
123456789101112131415161718192021DEFPARAM CumulateOrders = false//Heikin-AshixClose = (Open+High+Low+Close)/4if(barindex>2) thenxOpen = (xOpen[1] + xClose[1])/2endifGreen = xClose>xOpenharange = abs(xclose-xopen)Period=30inner = 2*weightedaverage[ round( Period/2 ) ](xclose)-weightedaverage[Period](xclose)MMHULL=weightedaverage[ round( sqrt(Period) ) ]( inner )macross = xclose crosses over MMHULLif green[1] and macross[1] and green and harange>harange[1] thenbuy at marketendifset target pprofit 50set stop ploss 25Everything working as intended as per my tests.
09/19/2018 at 1:01 PM #80874 -
AuthorPosts
Find exclusive trading pro-tools on