POINTSIZE
POINTSIZE returns the size of one point in price units for the current instrument, used in ProBacktest and ProOrder to convert prices into point counts.
Syntax
POINTSIZEHow it works
POINTSIZE is a read-only market constant that takes no arguments. It reports the size of a single point for the instrument the strategy is attached to, expressed in the instrument's own price units. On an index quoted at 18000 a point might be 1.0, while on a forex pair quoted to five decimals it is a small fraction, so the constant lets one strategy adapt to any quoting convention.
Its main job is unit conversion. Price-based series such as close or AverageTrueRange live in price units, while instructions such as SET STOP PLOSS and profit thresholds are often expressed in points. Dividing a price distance by POINTSIZE turns it into points, and multiplying a point count by POINTSIZE turns it back into a price distance that can be compared with quotes.
POINTSIZE describes distance only. The cash worth of a one-point move is a separate constant, POINTVALUE. A complete cash calculation typically uses both, first normalizing a price move into points, then converting points into money.
Examples
Example 1, Floating profit of the open position (ProBacktest)
// Unrealized gain of the open trade in account currency
floatingprofit = (((close - positionprice) * pointvalue) * countofposition) / pointsize
GRAPH floatingprofit AS "Floating profit"The distance between the current price and the average entry is scaled by the cash value of a point, multiplied by the position size, and normalized by POINTSIZE, yielding the unrealized profit in cash. This is the reference example from the source documentation with rewritten comments.
Example 2, Breakeven promotion after a fixed point gain (ProOrder)
// Move the stop to entry once the long is 10 points in profit
IF longonmarket AND (high - positionprice) >= 10 * pointsize THEN
SET STOP BREAKEVEN
ENDIFMultiplying 10 by POINTSIZE converts the point target into a price distance that can be compared directly with the gap between the high and the average entry price.
Example 3, ATR stop converted into whole points (ProBacktest)
// Express a two-ATR stop distance as an integer point count
atr = AverageTrueRange[14](close)
stopPoints = max(1, round((2 * atr) / pointsize))
IF NOT onmarket AND close > average[50](close) THEN
BUY 1 CONTRACTS AT MARKET
ENDIF
SET STOP PLOSS stopPointsATR is a price distance, so dividing by POINTSIZE produces the point count that SET STOP PLOSS expects, with rounding and a floor of one point to keep the value valid.
Common errors and gotchas
- POINTSIZE is not POINTVALUE. POINTSIZE is a distance in price units, POINTVALUE is the cash worth of that distance. Swapping them silently corrupts every risk calculation, because both are plain numbers and the compiler cannot catch the mistake.
- Point and pip can differ. On instruments quoted with fractional increments, PIPSIZE and POINTSIZE may not be equal. Code that treats them as interchangeable behaves differently across forex pairs and indices; check both constants for the target market.
- Hardcoded conversions. Replacing POINTSIZE with a literal such as 0.0001 ties the strategy to one quoting convention. The same code then produces wrong stop distances on any other instrument.
- Scope restriction. The constant compiles only in ProBacktest and ProOrder. Indicator or screener code that needs point arithmetic must use fixed parameter inputs instead.
Related instructions
POINTVALUE, the cash value of a one-point move.PIPSIZE, the size of one pip in price units.PIPVALUE, the cash value of one pip, synonym of POINTVALUE.TICKSIZE, the smallest tradable price increment.POSITIONPRICE, the average entry price of the open position.COUNTOFPOSITION, the signed size of the open position.BREAKEVEN, moves the stop or target to the entry price.PLOSS, stop loss expressed in points.
