PPROFIT

Category: ProBacktest

The PPROFIT instruction in ProBuilder language is used to set a profit target for a trading strategy. This target is defined in terms of points or pips relative to the entry price of the trade. The purpose of this instruction is to automatically close a position once the specified profit target is reached, helping traders to lock in profits according to their trading plan.

Syntax:

SET TARGET PPROFIT x

Here, x represents the number of points or pips as the profit target from the entry price.

Example:

myMACD = MACD[12,26,9](close)
long = myMACD crosses over 0
IF NOT LongOnMarket AND long THEN
    BUY 1 CONTRACTS AT MARKET
ENDIF
// Set profit target at 50 points
SET TARGET PPROFIT 50

In this example, a trading strategy is implemented where a buy order is placed if the MACD indicator crosses over the zero line and the market is not already long. After entering the market, the profit target is set to 50 points using the PPROFIT instruction.

  • The MACD (Moving Average Convergence Divergence) indicator is used here to determine the entry point. It is a trend-following momentum indicator that shows the relationship between two moving averages of a security’s price.
  • The crosses over 0 condition for MACD is a typical strategy to identify potential buy signals when the MACD line crosses above the signal line or zero line, indicating upward momentum.

This instruction is crucial for automated trading systems where managing risk and securing profits systematically is vital. By setting a profit target, traders can ensure that the system exits a position at a predetermined profit level, reducing the emotional impact on trading decisions.

Related Instructions:

  • %PROFIT probacktest
  • Logo Logo
    Loading...