Definition: In the ProBuilder language, PointValue refers to the monetary value of one point or pip in the currency of the financial instrument being traded. This value is crucial for calculating the financial impact of price movements in trading strategies.
Syntax:
PointValue
Example:
once MaxProfit = 50 //max daily profit objective in pips
once MaxLoss = 40 //max daily loss in pips
//max profit/loss achieved
if day<>day[1] then
strategyprofitpoint=0 //daily reset
endif
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
endif
In this code snippet, pointvalue is used to convert the profit or loss of a trading position from monetary terms into a standardized unit called “pips” or “points.” Here’s a brief description of its role:
pointvalue: Represents the monetary value of a single pip or point movement in the asset’s price. It is used to normalize the profit or loss calculation, making it easier to compare performance across different assets or timeframes.
Use in the Code:
-
Profit Calculation:
pnl(Profit and Loss) is calculated as the difference between the current strategy profit and the previous strategy profit.sizeis determined as the maximum of 1 or the absolute value of the previous count of positions, ensuring a non-zero divisor.oneposcalculates the average profit or loss per position by dividingpnlbysize.
-
Conversion to Points:
pointprofitconverts the per-position profit or loss (onepos) into points by dividing it bypointvalue. This standardizes the profit or loss, making it comparable to theMaxProfitandMaxLossthresholds, which are also defined in points.
-
Strategy Control:
strategyprofitpointaccumulates the total profit or loss in points for the day.allowtradingis a flag that enables or disables trading based on whether the accumulated points (strategyprofitpoint) have reached theMaxProfitorMaxLossthresholds.
Additional Information:
Understanding the PointValue is essential for traders using automated trading systems in ProRealTime. It helps in precisely managing trade sizes and risk, especially in markets where point values can vary significantly across different instruments or contracts. For beginners, it’s important to note that ‘pip’ is often used in forex trading to denote the smallest price move that a given exchange rate can make based on market convention.