Understanding Order Cancellations
If you're experiencing issues canceling orders, this article explains why cancellations fail and how to minimize these problems.
Why Orders Cannot Be Canceled
Order Already Filled
- An order cannot be canceled if it has already been filled. This typically occurs when prices change rapidly, especially in volatile markets.
- If the market fills an order before the broker processes a cancellation request, the broker will reject the cancellation.
- This rejection can occur even if you try to cancel an order at a price far from bid/ask, because sudden market spikes can complete an order before the cancellation can be processed.
- When using Replikanto, a cancellation on the leader account may not be processed on follower accounts if the order is filled before the cancellation can be copied.
Order Management System (OMS) Rejection
The message "Cancellation Rejected by the Order Management System" is generated by the broker's OMS when a cancellation request is received after the order has already been filled by the market.
Market Volatility
- Market volatility is a primary reason why cancellations may fail. Prices can change very rapidly, and an order can be completed before a cancellation or modification request is processed.
- Sudden market spikes may complete an order before the cancellation or change can be processed, even if you cancel or modify at a price far from bid/ask.
Order State
- Once an order is completed (filled), it cannot be changed or canceled.
- "Working" orders can be modified or canceled at any time before being filled.
- "Cancelled" orders cannot be modified or canceled.
Strategies to Minimize Cancellation Issues
Order Placement Best Practices
- Avoid attempting to cancel orders very close to the bid/ask price.
- Widen your stop orders — place orders a little further from the current bid/ask.
- Avoid trading in high volatility environments when possible.
- Consider using market orders to open positions, then setting profit target and stop-loss orders further from the bid/ask price.
Advanced Order Features
- Use OCO (One Cancels Other) orders to define position exit orders.
- Use the Follower Guard feature in Replikanto to flatten the follower account if a rejection message is received by the broker.
- When using Replikanto trade copier, the ATM Copy feature is highly recommended.
Replikanto and Order Cancellation
- When using Replikanto, if the leader cancels or changes an order, the action is copied to the follower account. However, the time it takes for this to happen may not guarantee that the order is canceled or changed because it could be filled earlier.
- When using Replikanto's cross order feature, there is an increased chance of an order not being filled on one side. This is because the two instruments may not move exactly in sync, especially during high volatility.
- Replikanto is designed to work with orders placed within the NinjaTrader environment. When orders are submitted by external programs, some information may be missing, which can lead to errors or undesired behavior.
Tradovate-Specific Issues
Frozen (Golden) Orders
Orders being frozen (golden orders) that cannot be canceled in NinjaTrader are due to network connectivity problems between NinjaTrader and the broker. When a client's connection to the order entry server is severed or unstable, it prevents order cancel, change, or position close commands from working as intended.
Solutions for Frozen Orders
- Disconnect and reconnect to the NinjaTrader brokerage connection to update pending orders in NinjaTrader so they can be canceled — this works in most cases.
- If the reconnection doesn't work, try canceling directly on the broker's website.
Tradovate API Rate Limits
- For Tradovate accounts, the API rate limit is 5,000 requests per hour (80 per minute) for the Tradovate/NinjaTrader connection. Orders and positions may freeze once this limit is reached.
- To avoid hitting the limit, we do not recommend using trailing stops or multiple price changes in a short period.
- NinjaTrader 8.1.4+ has fixed this issue (#14091) and will display a message that the Tradovate API rate limit has been reached. Older NinjaTrader versions will freeze orders without any explanation.
Alternative for Tradovate Users
You may find it helpful to use the Copy Market Orders (Executions) Only Replikanto feature, which allows you to copy only the executions to followers. For more information, view this informative video: https://youtu.be/WZ5rmeAuxZE
Summary
By understanding these factors — order fill timing, market volatility, OMS processing, broker-specific limitations, and API rate limits — you can better manage your orders and minimize the chances of failed cancellations.
Comments
0 comments
Article is closed for comments.