POINTVALUE
POINTVALUE returns the cash value of a one point move for the current instrument in ProBacktest and ProOrder, used for risk sizing and profit conversion.
Syntax
POINTVALUEHow it works
POINTVALUE is a read-only market constant. It takes no arguments and returns the monetary value, in the instrument's currency, of a one-point price move for one contract, lot, or share of the instrument the strategy runs on. In ProBuilder it is synonymous with PIPVALUE.
The constant is defined by the contract specification and varies widely across markets. One point on an index CFD may be worth 1 unit of currency per contract while one point on a futures contract is worth 25, so strategies that convert between points and cash must read POINTVALUE at runtime rather than assume a figure.
Two conversions cover most uses. Cash to points: divide a profit or loss by POINTVALUE (and by the position size when the amount covers several contracts). Points to cash: multiply a point distance by POINTVALUE and the number of contracts. Combined with POINTSIZE, which measures how big a point is in price units, this makes profit, risk, and sizing arithmetic portable across instruments.
Examples
Example 1, Daily profit and loss guard in points (ProOrder)
once MaxProfit = 50 // daily profit objective in points
once MaxLoss = 40 // daily loss limit in points
// Reset the daily counter on a new day
if day <> day[1] then
strategyprofitpoint = 0
endif
// Convert each realized profit change into points
if (strategyprofit <> strategyprofit[1]) then
pnl = strategyprofit - strategyprofit[1]
size = max(1, abs(countofposition[1]))
onepos = pnl / size
pointprofit = onepos / pointvalue
strategyprofitpoint = strategyprofitpoint + pointprofit
endif
allowtrading = 1
if (strategyprofitpoint >= MaxProfit or strategyprofitpoint <= -MaxLoss) then
allowtrading = 0
endifEach change in realized profit is divided by the position size and by POINTVALUE, turning cash into points. Trading is disabled for the rest of the day once the running point total hits either daily limit. This is the reference example from the source documentation with rewritten comments.
Example 2, Floating profit of the open position (ProBacktest)
// Unrealized profit converted from points into cash
IF onmarket THEN
floatingProfit = ((close - positionprice) / pointsize) * pointvalue * countofposition
ELSE
floatingProfit = 0
ENDIF
GRAPH floatingProfit AS "Open position profit"The distance from the average entry is normalized into points with POINTSIZE, then converted into cash with POINTVALUE and scaled by the signed position size.
Example 3, Sizing contracts from a cash risk budget (ProOrder)
// Size the trade so a 40 point stop risks about 150 in cash
riskCash = 150
stopPoints = 40
contracts = max(1, floor(riskCash / (stopPoints * pointvalue)))
IF NOT onmarket AND close CROSSES OVER average[20](close) THEN
BUY contracts CONTRACTS AT MARKET
ENDIF
SET STOP PLOSS stopPointsThe cash risk of one contract over the stop distance is stopPoints * pointvalue, so dividing the budget by that figure yields the contract count that keeps risk near constant across instruments.
Common errors and gotchas
- Per-contract figure. POINTVALUE describes one contract. Converting the profit of a multi-contract position requires dividing or multiplying by the position size as well, as in the daily guard example above.
- Confusing value with size. POINTVALUE is cash, POINTSIZE is a price distance. Using one where the other belongs produces results that are wrong by the ratio of the two, often several orders of magnitude.
- Assuming one instrument's value. A constant tuned for an index CFD is meaningless on a forex pair. Any hardcoded point value silently breaks portability; read the keyword instead.
- Scope restriction. The keyword compiles only in ProBacktest and ProOrder. Indicators and screeners cannot access contract specifications and must take such values as user inputs.
Related instructions
PIPVALUE, synonym of POINTVALUE, the cash value of one pip.POINTSIZE, the size of one point in price units.PIPSIZE, the size of one pip in price units.TICKSIZE, the smallest tradable price increment.STRATEGYPROFIT, realized strategy profit in cash.COUNTOFPOSITION, the signed size of the open position.POSITIONPRICE, the average entry price of the open position.GRAPH, plots a value in the backtest graph panel.
