I am trying to code an indicator that returns the close of the higher timeframe, that is, if the chart is TF 1 minute it returns the close of TF 5min, if chart is in TF 5 minutes it returns the close of TF 15min etc.
close of higher TF
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
a=gettimeframe/60
timeframe(5minutes,updateonclose)
close5=close
timeframe(15minutes,updateonclose)
close15=close
timeframe(default,updateonclose)
ifa=1then//if chart TF = 1 minute
c=close5//c = close of 5 minutes TF
elsifa=5then//if chart TF = 5 minute
c=close15//c = close from 15 minutes TF
endif
returnc
This code seems ok to me but it doesnt work, it just returns zero ! Any advise would be appreciated , thanks
Hi, it was a bug highlighted last november, as far as I know, it has been corrected for PRT trading with Interactive Broker, but fix not yet deployed for PRT with IG.
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue