POINTVALUE

Category: ProBacktest

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:

  1. Profit Calculation:

    • pnl (Profit and Loss) is calculated as the difference between the current strategy profit and the previous strategy profit.
    • size is determined as the maximum of 1 or the absolute value of the previous count of positions, ensuring a non-zero divisor.
    • onepos calculates the average profit or loss per position by dividing pnl by size.
  2. Conversion to Points:

    • pointprofit converts the per-position profit or loss (onepos) into points by dividing it by pointvalue. This standardizes the profit or loss, making it comparable to the MaxProfit and MaxLoss thresholds, which are also defined in points.
  3. Strategy Control:

    • strategyprofitpoint accumulates the total profit or loss in points for the day.
    • allowtrading is a flag that enables or disables trading based on whether the accumulated points (strategyprofitpoint) have reached the MaxProfit or MaxLoss thresholds.

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.

Related Instructions:

  • PIPSIZE probacktest
  • PIPVALUE probacktest
  • POINTSIZE probacktest
  • Logo Logo
    Loading...