//PRC_Heikin Ashi higher TF | indicator
//22.02.2018
//Sharing ProRealTime knowledge
//https://www.prorealcode.com/topic/heikin-ashi-4-hours-in-a-1-minute-timeframe/
// — settings
// — end of settings
defparam calculateonlastbars=10000 //increase this number to get more history
Timeframeadx = 4 //higher TF number (only hours)
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+Timeframeadx
wend
endif
if hourcheck then
opentf=open
hightf=0
lowtf=close*100
aadx=adx[14]
drawvline(barindex)coloured(100,100,100)
//drawtext(“#haopen#”,barindex,1.1)
endif
hightf = max(hightf,high)
lowtf= min(lowtf,low)
aadx=adx[14]
opentf=opentf
r=0
g=0
b=140
if aadx<aadx[1] then
r=200
g=0
b=200
endif
if aadx>aadx[1] and aadx[1]<aadx[2] then
signal=0.1
elsif aadx<aadx[1] and aadx[1]>aadx[2] then
signal=–0.1
else
signal=0
endif
return 1 coloured (r,g,b) style(histogram) as “HeikinAshi higherTF color”, signal style(histogram) as “HeikinAshi higherTF change”