EXITSHORT is a command used in the ProBuilder programming language, specifically designed for trading strategies to close an existing short position. This instruction is crucial for implementing precise exit strategies in automated trading systems.
EXITSHORT x SHARES
Where x represents the number of shares or lots to close from the short position.
myMACD = MACD[12,26,9](close)
short = myMACD crosses under 0
exit = myMACD crosses over 0
IF NOT SHORTONMARKET AND short THEN
SELLSHORT 1 LOT AT MARKET
ENDIF
IF SHORTONMARKET AND exit THEN
EXITSHORT AT MARKET
ENDIF
In this example, the strategy uses the MACD indicator to determine entry and exit points for a short trade. The SELLSHORT command is used to enter a short position when the MACD line crosses below zero, indicating a potential downtrend. Conversely, the EXITSHORT command is used to close the short position when the MACD line crosses above zero, suggesting a reversal or weakening of the downtrend.
This command is essential for traders who use automated systems to ensure that they can exit positions efficiently and effectively, minimizing losses and protecting gains in volatile markets.