I would like to run a simple calculation starting from the market open (5pm in the example of the ES) and repeat this every 5 bars.
Eg when the market opens, calculate the max value - the min value of the previous 5 bars and plot this value. Repeat this calculation every 5 bars for the remainder of the day.
I can't work out how to put this into practise - whether it's a 'for' loop or something else.
Any suggestions would be gratefully received.
Thanks!

Comment