TypicalPrice
TypicalPrice returns the average of the high, low, and close of a bar in ProBuilder. Use TypicalPrice, or TypicalPrice[N] N bars ago, as a balanced price source.
Syntax
TypicalPriceTypicalPrice[N] returns the value N bars back, where N is 0 for the current bar, 1 for the previous bar, and so on. TypicalPrice and TypicalPrice[0] are equivalent.
How it works
TypicalPrice is the mean of the bar's high, low, and close, (High + Low + Close) / 3. By blending the range extremes with the settlement price, it produces a single representative value that reflects both how far the bar travelled and where it finished.
The bracket offset addresses earlier bars, so TypicalPrice[1] is the previous bar's typical price. The index must remain within the loaded history.
This price is the classic basis for indicators such as the CCI and for pivot-point formulas, where a balanced summary of the bar is preferred over the close alone. On the live bar it can shift as the high, low, or close updates.
Examples
Example 1, Typical price against its average (Indicator)
// Moving average of the typical price
ma = Average[20](TypicalPrice)
RETURN TypicalPrice AS "Typical price", ma AS "MA 20"The indicator plots the typical price with a moving average built from the same series.
Example 2, Screening on typical-price strength (ProScreener)
// Typical price above its 50-bar average
above = TypicalPrice > Average[50](TypicalPrice)
SCREENER[above] (TypicalPrice AS "Typical price")The screener returns instruments whose typical price sits above its longer average.
Example 3, Typical-price crossover entry (ProOrder)
DEFPARAM CumulateOrders = false
fast = Average[10](TypicalPrice)
slow = Average[30](TypicalPrice)
IF fast CROSSES OVER slow THEN
BUY 1 CONTRACT AT MARKET
ENDIF
IF fast CROSSES UNDER slow THEN
SELL AT MARKET
ENDIFBoth averages read TypicalPrice, so the crossover uses the blended bar price rather than the close.
Common errors and gotchas
- Not the same as MedianPrice.
TypicalPriceincludes the close and divides by three, whileMedianPriceuses only high and low. The two differ whenever the close is away from the bar's midpoint. - Live bar moves. On the current bar the high, low, or close can change, shifting
TypicalPriceuntil the bar completes. - Offset out of range.
TypicalPrice[N]fails when N points before the first loaded bar. Guard long lookbacks or load more history.
Related instructions
MedianPrice, the average of high and low.WeightedClose, a close-weighted average of high, low, and close.TotalPrice, the average of open, high, low, and close.CustomClose, the user-selectable price source.High, the highest price of a bar.Low, the lowest price of a bar.Close, the closing price of a bar.Volume, the traded volume of a bar.
