Cancel Orders
Cancel unfilled base orders for specified trades, providing a way to remove pending entry orders that have not yet been executed. This rule is essential when market conditions change and previously placed orders are no longer aligned with your strategy. It specifically targets base orders (entry orders) while leaving stop loss and take profit orders intact, so your existing risk management remains in place.
How It Works
The Cancel Orders rule takes a list of trade IDs and examines each one for unfilled base orders. For every trade in the list, it locates orders that are in one of the following statuses and sends cancellation requests for them:
- New — Orders that have been submitted to the broker but have not yet been filled.
- Pending New — Orders that are queued and waiting to be submitted to the broker.
- Silent New — Orders that are being held by the system (not yet sent to the broker) and are waiting for their trigger conditions to be met.
This rule only targets base orders, which are the primary entry orders for a trade. It does not cancel stop loss or take profit orders. This distinction is important because it allows you to cancel pending entries while preserving the protective exit orders on any trades that have already been filled.
This functionality is particularly useful when market conditions change rapidly and previously placed orders are no longer desirable. For example, if your strategy placed a grid of limit orders but volatility has spiked due to an unexpected news event, you can use this rule to cancel all unfilled orders in the grid to prevent new positions from being opened in unfavourable conditions.
Inputs
| Input | Description | Required | Default |
|---|---|---|---|
| Cancel Base Orders | A list of trade IDs for which unfilled base orders should be cancelled. The rule will locate any non-filled entry orders associated with these trade IDs and cancel them. | Yes | — |
Outputs
This rule has no outputs. Once the cancellation requests have been sent, the action is complete. Orders that were already filled before the cancellation request was processed will remain open as active positions.
Tips
When using the Place Trades rule to create a grid of orders, connect the Trade Id(s) output to a Cancel Orders rule triggered by a condition that detects adverse market conditions (such as a volatility spike or a news event filter). This ensures unfilled grid orders are automatically removed when conditions become unfavourable. Remember that if the Place Trades rule has the Close on Cancel option enabled, any order that was filled between the time you sent the cancel request and when it was processed will be automatically closed as well, providing an additional layer of protection.
Was this helpful? Let us know