I have two array’s that tracks the higher highs in a market, one tracks the price at the high and the other tracks the bar index. I am having trouble of finding a solution of what i want to do when a higher high is detected. as of now, when a higher high is found, I am able to find the the two bar indexes (prev high and the current high)
I have tried subracting the current high’s bar index by the prev’s highs index, giving me a “lookback” for how many bars have past. I then tried running a for loop to search how ever many bars since the prev high using ta.lowest(low, loopback) but it seems pinescript doesnt like running ta. in if statements.
If there’s a way to find lows or high between two bar indexes, any insight would be great. thanks in advanced!
Jonathan Kat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.