I am attempting to write a script to draw horizontal lines from past highs. For example, say I wanted to draw a horizontal line on the high of the first Monday of the last 5 months. Also, would like to not have to have all these months in view on the chart at the time.
I currently have an array of days I can iterate through, but looking at the docs, it does not appear there is a way to get the high / low of a security on a specific past date.
In version 5 (the only version I have worked with) using request.security does not work in a loop, and even if it did, it does not appear to allow to get security high on a given timestamp but only at a candle point.
This seems like a pretty simple thing to do, but the docs do not show me anything that resembles what I need.
I feel like I may be going about it wrong. Pine script is an interesting time based language that I am not familiar with yet. Any ideas out there?