The LowestBars function in ProBuilder language is designed to identify the position of the lowest value within a specified period of bars. This function is particularly useful for traders and analysts who need to determine how many bars ago the lowest price or value occurred in a given dataset.
LowestBars[Period](source)
Parameters:
a = LowestBars[20](low)
return a
In this example, the LowestBars function is used to find the bar position of the lowest low price in the last 20 bars. The result is stored in the variable a. If the lowest value is found at the current bar, it returns 0; if it’s found at the previous bar, it returns 1, and so on. If no lower value is found within the specified period, it returns -1.
This function is essential for technical analysis, particularly when looking for historical lows over a specific period as part of a trading strategy or market analysis.