Forums › ProRealTime English forum › ProBuilder support › Hourly Average plotted in Higher timeframe › Reply To: Hourly Average plotted in Higher timeframe
05/20/2019 at 9:11 AM
#98864
This works (but, as you can see from attached pic, there’s a slight difference):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
//higher timeframe minutes count HigherTFminutes = 60 //Can be lower (in this case) //current timeframe minutes count CurrentTFminutes = 240 //AVG period to display AVGperiod = 200 if hour<>hour[1] then c = close endif currentAVG = average[AVGperiod](close) factor = HigherTFminutes/CurrentTFminutes x = max(1,round(AVGperiod*factor)) MTFAVG = average[x](c) RETURN currentAVG as "current TF AVG", MTFAVG as "higher/lower TF AVG" |