The LOSS instruction in ProBuilder language is used to set a stop loss for an open trading position. A stop loss is a predefined price level at which a losing position will be closed to prevent further losses. This instruction is crucial for risk management in trading strategies.
SET STOP LOSS x
Here, x represents the distance from the average position price at which the stop loss should be set. The value of x should be specified in the price units of the traded instrument.
myMACD = MACD[12,26,9](close)
long = myMACD crosses over 0
IF NOT LongOnMarket AND long THEN
BUY 1 CONTRACTS AT MARKET
SET STOP LOSS 0.0050
ENDIF
In this example, a trading strategy is implemented where a buy order is placed if the MACD indicator crosses over zero and there is no long position already in the market. After placing the buy order, a stop loss is set 0.0050 units away from the average position price. This example assumes the instrument is traded with five decimal places.
This instruction is essential for traders using automated trading systems in ProBuilder, as it helps in implementing effective risk management strategies.