This indicator displays the colors of the heikin ashi candles of the higher timeframe (to be chosen with the “TimeframeHeikinAshi” parameter) under the price graph in a separate window.
In the example we display the HeikinAshi candle colors of timeframes H1, H4 and Daily. The indicator is only compatible with in hours format units, the possible parameters are:
1 = H1
2 = H2
etc.
1440 = Daily (D1)
etc.
At each new bar detected, the indicator displays a vertical bar of gray color.
With each change of color of the heikin ashi bar of the higher timeframe, a “signal” (black histogram) is displayed, this allowing you to recover the information for the creation of an automatic trading strategy for example. It is therefore possible to recover all the changes of direction of each candlestick that took place inside it without waiting for the Close.
//PRC_Heikin Ashi higher TF | indicator
//22.02.2018
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//https://www.prorealcode.com/topic/heikin-ashi-4-hours-in-a-1-minute-timeframe/
defparam calculateonlastbars=10000 //increase this number to get more history
// --- settings
TimeframeHeikinAshi = 4 //higher TF number (only hours)
// --- end of settings
once NbBar = 1
MyDay=openday
dayminutes = 1440*(MyDay-MyDay[1])
MyHour=openhour
hourminutes = 60*(MyHour-MyHour[1])
MyMin=openminute
barminutes = MyMin - MyMin[1] + hourminutes + dayminutes
barminutes=abs(barminutes)
Mybarminutes = lowest[max(1,NbBar)](barminutes)[1]
//check hours
hourcheck=0
i=0
if MyBarMinutes>=59 then
hourtest=openhour
go=1
else
hourtest=hour
go=0
endif
if minute=MyBarminutes or go then
while i<1440 do
if(hourtest=i) then
hourcheck=1
break
endif
i=i+TimeframeHeikinAshi
wend
endif
if hourcheck then
opentf=open
hightf=0
lowtf=close*100
haopen=(haopen[1]+haclose[1])/2
drawvline(barindex)coloured(100,100,100)
//drawtext("#haopen#",barindex,1.1)
endif
hightf = max(hightf,high)
lowtf= min(lowtf,low)
haclose=(opentf+close+lowtf+hightf)/4
r=0
g=200
if haclose<haopen then
r=200
g=0
endif
if haclose>haopen and haclose[1]<haopen[1] then
signal=0.1
elsif haclose<haopen and haclose[1]>haopen[1] then
signal=-0.1
else
signal=0
endif
return 1 coloured (r,g,0) style(histogram) as "HeikinAshi higherTF color", signal style(histogram) as "HeikinAshi higherTF change"
You must be logged in to post a comment.
This is an excellent indicator, it provides a hugely useful visual interpretation that filters entries well. Thanks for creating it. I'm finding it particularly useful for scalping the DAX and DOW whilst using a hull ma and HA candles. One thing I've noticed is that the histogram colours change when you vary the units displayed, and that the colours don't always reflect the actual HA candle colour. Different time frames with the same indi also vary in the way they show higher TF candles. Is there an optimal units and or time frame for best consistency?
Bonjour Nicolas J'ai mis cet indicateur sur une période graphique 1 heure. J'ai choisi 1 pour 1 heure, 2 pour 2 heures. Mais que faut-il choisir dans propriétés comme valeur de TimeframeHeikinAshi pour obtenir un indicateur ''daily''. Je n'obtiens qu'un histogramme vert que je choisisse 24 ou 1440 ce qui n'est pas la réalité si on se réfère à un graphe daily avec données Heikin ashi Je suis en difficulté sûrement pas insurmontable mais je ne sais pas la manœuvre ou l'astuce. Merci par avance de votre aide.
Sorry Nicolas...wasn't what I was thinking to do...I thought you couldn't received the notification of the messages if I don't insert the "#"....anyway thanks for the answer and for the time u dedicate to us!!!!! What about the other question I would like to know? You can see it on the posts above...it's about why I have to indicate the daily tf with 1440 and instead the one houre with 1....the mtf is express in minite or houres? Many thanks
Hi Nicolas, can you create the same indicator for the heikin ashi smoothed? I've tried to create by myself putting the heikin smoothes code after the "if hourecheck then" but It doesn't work...need help please:)
Sorry guys...why to indicate the daily timeframe we have to use 1440 and not 24 if this indicator is set in houres? If 1 is for 1houre, 2 is for 2 houres...24 should be for the daily...why I'm wrong? Thanks to the one that can answer!
Hi Nicolas! thanks for this indicator! I don't understand why to indicate the daily timeframe we have to use 1440 and not 24...if it is set in houres it should be 24 to indicate a daily candle... what I don't understand? thanks
Congratulations Nicolas for one more briliant indicator, this might become the new favorite indicator for a Heiken Ashi fetischist as myself :) However I'm puzzled regarding how we can easily use as a signal or filter in strategies since it seems tricky to find something for the strategy to differentiate longs from shorts by color, the change is easier to manage but if it is already showing one color and we want to enter a position based on the current color. Would it be possible to modify the indicator to only return one value and possibly set longs to equal 1 and shorts to equal -1? Hence we can use CROSSES OVER/UNDER 0 for change and >0 or <0 to enter on current signal. What do you think?
As always you're one step ahead Nicolas. I figured that out on my own yesterday before I noticed your reply. Another question though, do you think you might be able to find time to creat another version adapted for minutes TFs? Such as running it on m1 showing the Heiken Ashi candle of 5,15 and 30 minutes, combined with the current indicator showing H1 or H4 that can become a very powerful strategy.
Thank you!