QUIT

Category: ProBacktest

The QUIT instruction in ProBuilder language is used to immediately stop a trading system. This command halts all trading activities, including the closure of any open positions and the cancellation of all pending orders such as stop and limit orders. Once a strategy is stopped using the QUIT instruction, it cannot be restarted automatically through code; manual intervention is required to re-launch the strategy.

Syntax:

QUIT

Examples:

  • Example 1: Stop the automated trading program at 22:00 if the strategy is currently short in the market.
    IF ShortOnMarket AND CurrentHour = 22 THEN
      QUIT
    ENDIF
  • Example 2: Terminate the strategy if the current profit falls below a loss of 200 units of the account currency.
    IF StrategyProfit < -200 THEN
      QUIT
    ENDIF

This instruction is crucial for implementing risk management protocols within a trading strategy, allowing the trader to define specific conditions under which trading should cease to prevent further losses or to lock in profits under certain scenarios.

Logo Logo
Loading...