mizu
Pine Script Rookie
Pine Script Rookie
Posts: 1
Joined: November 8th, 2022

Bar index of ta.highest bar

Hi, :zen:

It's something I cudnt gest solution for, maybe You guys know the way..

There is an array with list of several bar_index values

For this values I want to find the bar with the highest high, and store that bar_index/value in anothe arry

is there any good way of geting the bar_index of the ta.highest(high, 20)? :annoyed:

BR
Michal

Steve Burman
Moderator
Moderator
Posts: 109
Joined: January 13th, 2023

Re: Bar index of ta.highest bar

Hi Michal,

Yes, the theory of loading up the highest high values and bar_index over the last 20 bars into an array is good. I'd love to help but my experience with arrays is limited. Hopefully someone else can help you.

Return to “Pine Script Q&A”