The $PROFIT instruction in ProBuilder language is used to set a specific profit target for a trading strategy. This instruction allows traders to specify an amount in the currency of the traded instrument, at which the position should be closed to capture a predetermined level of profit.
SET TARGET $PROFIT x
Here, x represents the profit target amount in the currency of the instrument.
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 100$
SET TARGET $PROFIT 100
In this example, a trading strategy is defined using the MACD indicator, where a buy order is placed if the MACD line crosses over the zero line and there is no long position already in the market. After placing the buy order, a profit target of $100 is set using the $PROFIT instruction.
This instruction is crucial for implementing risk management strategies within automated trading systems, ensuring that trades are closed at profit levels that align with the trader’s objectives.