Range

Category: Constants

The Range function in ProBuilder language is used to calculate the difference between the highest and lowest prices within a specific bar on a chart. This function is particularly useful for traders and analysts to measure the volatility or the price movement within a single trading period.

Syntax:

Range[N]

Here, N represents the index of the bar relative to the current bar. N can be any integer. Range without an index refers to the current bar.

Example:

currentrange = Range
previousrange = Range[1]
IF (currentrange < previousrange AND high < high[1]) THEN
    NearPossibleBullishBreakout = 1
ELSE
    NearPossibleBullishBreakout = 0
ENDIF
RETURN NearPossibleBullishBreakout

This example demonstrates how to use the Range function to compare the range of the current bar with the range of the previous bar. It also checks if the current high is lower than the previous high. If both conditions are met, it suggests a possible bullish breakout scenario by setting NearPossibleBullishBreakout to 1, otherwise, it sets it to 0.

  • The Range function is essential for analyzing the spread between the high and low prices of a bar, which can indicate the level of market activity or volatility during that period.
  • Using indices with the Range function (e.g., Range[1], Range[2]) allows comparison between different bars, which can be critical for identifying trends or patterns in price movements.
Logo Logo
Loading...