heikin ashi of higher timeframes under h1
Forums › ProRealTime English forum › ProBuilder support › heikin ashi of higher timeframes under h1
- This topic has 14 replies, 3 voices, and was last updated 6 years ago by martinr.
-
-
05/26/2018 at 1:04 PM #71396
Hi, I’m looking for a Heiken Ashi indicator that paints candles from a higher time frame . For instance my system operates in m1 and I am looking to validate entries if the HA candles in m15 or m5 are in the same direction than the m1 order (green HA in m5/m15 for m1 buy or red HA in m5/m15 for sell order). I found a nice indicator by Nicolas Heikin Ashi of higher timeframes (hourly TF) but the minimum TF there is H1. Is there anything similar for lower TF ?
Thanks
05/27/2018 at 6:01 PM #71441I finally tweaked Nicolas indicator code Heikin Ashi of higher timeframes (hourly TF) to allow for 5 & 15 min TF:
higher TF HekinAshi candles12345678910111213141516171819202122232425262728293031defparam calculateonlastbars=10000 //increase this number to get more historyTimeframeHAminutes = 15 //higher TF for HA in minutesMyminutes = openhour*60 + openminuteif (Myminutes MOD TimeframeHAminutes = 0) thenopentf = openhightf = 0lowtf = close * 100haopen =( haopen[1]+haclose[1])/2drawvline(barindex)coloured(100,100,100)endifhightf = max(hightf,high)lowtf= min(lowtf,low)haclose=(opentf+close+lowtf+hightf)/4r=0g=200if haclose<haopen thenr=200g=0endifif haclose>haopen and haclose[1]<haopen[1] thensignal=0.1elsif haclose<haopen and haclose[1]>haopen[1] thensignal=-0.1elsesignal=0endifreturn 1 coloured (r,g,0) style(histogram) as "HeikinAshi higherTF color", signal style(histogram) as "HeikinAshi higherTF change"Regards
05/29/2018 at 4:35 PM #71613Hi Pableitor, I thank you so much for sharing this.
I would like to ask you for your help and maybe the help of Nicolas. I am desperate to display a Heiken Ashi indicator in m1. My system operates in s1. I try in TimeframeHAminutes in your indicator but it does not work. Can you help me please ?
Thanks for your help.
05/29/2018 at 4:43 PM #7161805/29/2018 at 4:51 PM #71620Hi Nicolas, I would like to display Display M1 Heikin Ashi candlesticks on a S1 (1 second) timeframe. I think it’s possible. Thank you for your help.
I take this opportunity to saluate the extraordinary work you have done in creating this forum and all the indicators that you share. Bravo!
05/29/2018 at 5:43 PM #71626oh sorry, S1 means 1 second TF .. of course 🙂
Yes, I think that it would be possible to adapt the code that @pableitor has shared with us.
Did you try to modify the setting just with:
1TimeframeHAminutes = 1Because it returns some red/green values in the 1 sec TF (see example attached).
1 user thanked author for this post.
05/29/2018 at 6:26 PM #7162905/29/2018 at 6:43 PM #7163105/29/2018 at 7:34 PM #71632Hi martinr,
Pls check below code.
123456789101112131415161718192021222324252627282930defparam calculateonlastbars=3000 //increase this number to get more historyTimeframeHAseconds = 60 //higher TF secondsMyseconds = openhour*3600 + 60*openminute + opentime MOD 60if (Myseconds MOD TimeframeHAseconds = 0) thenopentf = openhightf = 0lowtf = close * 100haopen =( haopen[1]+haclose[1])/2drawvline(barindex)coloured(100,100,100)endifhightf = max(hightf,high)lowtf= min(lowtf,low)haclose=(opentf+close+lowtf+hightf)/4r=0g=200if haclose<haopen thenr=200g=0endifif haclose>haopen and haclose[1]<haopen[1] thensignal=0.1elsif haclose<haopen and haclose[1]>haopen[1] thensignal=-0.1endifreturn 1 coloured (r,g,0) style(histogram) as "HeikinAshi higherTF color", signal style(histogram) as "HeikinAshi higherTF change"I tweaked Nicolas indicator further so you can configure the higher TF in seconds (for m1 TimeframeHAseconds = 60) and display the m1 HA candle in a s1 chart. I found sometimes the 1sec candle is missing in the streaming data which may lead to small inaccuracies when the missing s1 candle is the first one of each minute. Beside this it seems to work fine, pls check it and advise if you need any info.
05/30/2018 at 11:15 AM #71681Thank you pableitor for your time. It works a lot better but there are still significant gaps between the “real” Heikin-Ashi “1 min and the one displayed on a graph of 1 sec.I also find that nothing is displayed after 3000 units which is logical since there is 3000 bar (calculateonlastbars) but even with 1000 bar, the signal is never at 0. This causes white margins.
05/30/2018 at 1:33 PM #71689Yes, I know what you mean. The program takes the open at the very first second of each minute to calculate open for the next m1 HA candle , but I found at 1 sec level sometimes theres a data gap at the very first second of the minute so it loses accuracy. At higher TF it works pretty good but I dont know how to tweak it to replace that missing 1sec data , sorry!
05/30/2018 at 3:44 PM #7171205/30/2018 at 6:44 PM #71725calculateonlastbars=3000 should load like 50 min of 1 sec data. The bigger the better precision but takes longer to load. Anyway I think the problem is also the s1 missing data. Maybe somebody from PRT could tell us how to calculate m1 HA candles when the open 1sec data is missing !
05/31/2018 at 8:04 AM #71813You should use tick charts instead (tick by tick), no missing data because of clockwork in this case. Just like the way I did in this indicator: Cumulative Volume Delta with periods
06/01/2018 at 6:14 PM #71979 -
AuthorPosts
Find exclusive trading pro-tools on