The LIMIT instruction in ProBuilder language is used to place a limit order in the trading strategy. A limit order is an order to buy or sell a security at a specific price or better. In the context of automated trading, this instruction allows traders to specify the exact price at which they are willing to execute a trade, rather than executing at the current market price.
BUY AT x LIMIT
myMACD = MACD[12,26,9](close)
long = myMACD crosses over 0
IF long THEN
BUY 1 LOT AT close-10 LIMIT
ENDIF
In this example, a Moving Average Convergence Divergence (MACD) indicator is used to determine the trading signal. The MACD is a trend-following momentum indicator that shows the relationship between two moving averages of a security’s price. The trade is executed with a limit order to buy one lot when the MACD crosses over zero, at a price 10 points below the closing price.
This instruction is particularly useful in strategies where the entry price is crucial for the trade setup. It helps in avoiding slippage and ensures that the trade is executed within the parameters set by the trader.