TARGET

Category: ProBacktest

The TARGET instruction in ProBuilder language is used to set a profit target for a trading position in terms of price movement. This instruction is crucial for implementing a strategy where a specific profit goal is predefined, allowing the trading system to automatically close a position once the target profit level is reached.

Syntax:

SET TARGET PROFIT x

Here, x represents the target profit amount expressed in points or pips. The value of x should be adjusted based on the point size of the traded instrument.

Example:

myMACD = MACD[12,26,9](close)
long = myMACD crosses over 0
IF NOT LongOnMarket AND long THEN
    BUY 1 CONTRACTS AT MARKET
    SET TARGET PROFIT 20
ENDIF

In this example, a trading strategy is implemented using the MACD indicator. A buy order is placed when the MACD line crosses over the zero line, indicating a potential upward trend. The SET TARGET PROFIT 20 instruction sets a profit target of 20 points above the entry price. If the price reaches this target, the position will be closed automatically to secure the profit.

  • 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 condition checks for a crossover of the MACD line from below to above the zero line, suggesting a bullish signal.

This instruction is particularly useful in automated trading systems where managing risk and securing profits systematically is crucial. By setting a profit target, traders can ensure that profitable trades are closed at predetermined levels, potentially enhancing the consistency of their trading strategy.

Related Instructions:

  • BREAKEVEN probacktest
  • STOP probacktest
  • Logo Logo
    Loading...