Constants/probuilder · probacktest · proorder · proscreener

High

High returns the highest price of a bar in ProBuilder. Use High, or High[N] for the high N bars ago, as a price source in indicators, screeners, and strategies.

Syntax

probuilder
High

High[N] returns the highest price N bars back, where N is 0 for the current bar, 1 for the previous bar, and so on. High and High[0] are equivalent.

How it works

High reads the peak price reached during a bar on the chart's working timeframe. On the current, unfinished bar the high can rise as trading pushes higher, so it may increase tick by tick until the bar closes.

The bracket offset addresses earlier bars relative to the one being processed. High[1] is the previous bar's high and High[10] is the high ten bars ago. The index must remain within the loaded history, since reaching past the oldest bar produces an error.

To find the highest high over a window rather than a single bar, use the Highest function, for example Highest[20](High). Breakout strategies frequently compare the current price against a recent Highest[N](High) level to detect a move above prior resistance.

Examples

Example 1, Distance below the recent high (Indicator)

probuilder
// How far the close sits below the highest high of the last 20 bars
recentHigh = Highest[20](High)
gap = recentHigh - Close
RETURN gap AS "Below 20-bar high"

The indicator measures how far price has pulled back from its recent peak.

Example 2, Screening for new highs (ProScreener)

probuilder
// Current high exceeds the highest high of the previous 50 bars
newHigh = High > Highest[50](High)[1]

SCREENER[newHigh] (High AS "High")

The screener returns instruments printing a fresh 50-bar high on the latest bar.

Example 3, Breakout entry above prior high (ProOrder)

probuilder
DEFPARAM CumulateOrders = false

// Highest high of the last 20 completed bars
level = Highest[20](High)[1]

IF Close > level THEN
  BUY 1 CONTRACT AT MARKET
ENDIF

SET STOP %LOSS 2

The strategy enters when the close clears the highest High of the preceding twenty bars.

Common errors and gotchas

  • Offset out of range. High[N] fails when N points before the first loaded bar. Guard long lookbacks or load enough history.
  • Single bar versus window. High[5] is the high of one bar five back, not the highest high of the last five bars. For a rolling maximum use Highest[5](High).
  • Live bar can extend. On the current bar the high may keep rising until close, so breakout tests against the live high can trigger early. Compare against completed bars with High[1] for confirmation.
  • Low, the lowest price of a bar.
  • Open, the opening price of a bar.
  • Close, the closing price of a bar.
  • Volume, the traded volume of a bar.
  • Range, the high minus low of a bar.
  • CustomClose, the user-selectable price source.
  • MedianPrice, the average of high and low.
  • DHigh, the highest price of a past daily bar.