The SELL instruction in ProBuilder language is used to close a long position in a trading strategy. This command is essential for implementing exit strategies when certain conditions are met, ensuring that the strategy can lock in profits or prevent further losses.
SELL AT MARKET
IF LongOnMarket AND ExitConditions THEN
SELL AT MARKET
ENDIF
This example demonstrates how to use the SELL instruction to exit a long position when the market conditions specified by ExitConditions are met while the strategy is currently in a long position (indicated by LongOnMarket).
This instruction executes a market order to sell, which means the position will be closed at the current market price. It is crucial for traders to understand that the execution price can vary slightly from the last market price due to market volatility and execution speed.
Using the SELL instruction effectively requires careful consideration of the exit conditions to ensure they align with the trading strategy’s goals and risk management practices.