End Strategy
The End Strategy rule safely terminates a strategy by stopping all execution and actively closing every open position and cancelling every pending order. Unlike Stop Strategy, which only halts rule processing, End Strategy performs a complete cleanup to ensure no trades or orders remain active after the strategy shuts down.
How It Works
When the End Strategy rule fires, it performs two actions in sequence. First, it halts all strategy rule evaluation and signal processing, just like Stop Strategy. Second, it sends close requests for all open positions and cancellation requests for all pending orders associated with this strategy. This ensures a clean shutdown with no lingering exposure in the market.
This rule is the recommended way to terminate a strategy when you want to ensure that no positions or orders remain active. It is commonly used as an automated safety mechanism, triggered by conditions such as reaching a maximum drawdown limit, hitting a daily loss threshold, or detecting abnormal market conditions that warrant a full exit.
If you only want to stop the strategy without affecting existing positions and orders, use Stop Strategy instead.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
| This rule has no configurable inputs. It fires when triggered by its upstream dependencies. | |||
Outputs
| Output | Type | Description |
|---|---|---|
| This rule does not produce any outputs. It acts as a strategy-level control signal that halts execution and closes all positions and orders. | ||
Tips
End Strategy is your safest shutdown option for live trading. Connect it to a condition that monitors your maximum acceptable drawdown or daily loss limit. When the threshold is breached, End Strategy will close everything and stop the strategy, protecting your capital. For session-based strategies, connect it to a Schedule At rule timed to the end of your trading session to ensure all positions are closed before you stop monitoring the market.
Was this helpful? Let us know