I would like create an array which is the highest high of the closes for the next 200 bars into the future. This array needs to be recalculated at each next bar until I have reached the end of the price array. My intention is to use this in a loop for some other calculations I need to do.
I would also like to visualise this line by plotting it from the current selected bar.
I've had a few goes at this but it quickly goes nowhere. Any suggestions would be appreciated.
Below is a photoshopped screenshot of what I am trying to describe.
The way I see it is that I may need a nested loop to calculate a fresh HHV array at each bar. So at iteration i I would then enter a sub-loop and iterate into the future 200 times to construct the HHV array and so on.
None of this solves the problem. The array needs to be based on the first bar being the current cursor location. No past bars can be used to construct the array which is what the KB article @portfoliobuilder linked to does.
Based on the first post's picture's red line it looks like you are rather looking for HighestSince selected bar and line being as long as lookforward variable.