'"Highest value offset for a given number of bars back" meaning?

I'm new to Pine script, please, anyone explain me exactly what this high[abs(highestbars(amplitude))] statement returns, specially in highestbars(2) definition what it mean Highest value offset?? FYI this statement is from Tradingview.com HalfTrend script, thanks



Solution 1:[1]

highestbars() will give you the bar index offset of the highest bar in the given range.

For example, if highestbars(5) returns -2, you know that the highest bar within the last 5 bars was 2 bars ago.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vitruvius