NexusFi: Find Your Edge


Home Menu

 





Tradestation rejected orders cancelling automation.


Discussion in TradeStation

Updated
    1. trending_up 7,041 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
KPreston
Harrisburg PA, USA
 
Posts: 2 since Sep 2014
Thanks Given: 1
Thanks Received: 0

So here's the issue I'm having, If you place two orders through strategy automation, one a sell above the current bar and one a buy below the current bar, Tradestation on their end will hold both but only place the order you are closer to. If the price action starts to become very fast an error can occur where Tradestation attempts to cancel an order before it is sent. Now, this issue is on Tradestations side not in the code which I know for certain from troubleshooting with Tradestation Easylanguage support. What I'm trying to do as a work around and not having any luck with yet is in 'using elsystem' to listen for a rejection and then recalculate(restart) the strategy so it continues in automation. Of that attempted solution my only problem is I have been unable to find any way to listen for a rejected order. Mind you, I'm not actually placing the order again, it's only calculated end of bar, Tradestation is holding both orders and placing one or the other based on proximity so I need to not listen for a rejection on an order I'm placing but just any rejection at all on the account. Thanks for the help! And let me know if my explanation isn't cutting I'm still finding it a little confusing myself!


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Second Night of US Strikes Crushes Iran June 15 to 3.6% …
Prediction Markets & Event Contracts
The 50/50 Paradox: Peace and Invasion Each at 20% -- Ira …
Prediction Markets & Event Contracts
SEC and CFTC Unlock Customer Cross-Margining for Treasur …
Treasury Notes and Bonds
Iran Lebanon Problem Kills Switzerland Talks, Brent at $ …
Prediction Markets & Event Contracts
Warsh Opens Today, Hormuz June 19 -- WTI Below $80, Fran …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
205 thanks
Sober Journey With S&P
21 thanks
30 Sessions
20 thanks
Volume Indicators
8 thanks
Thanks Mike. Godspeed.
7 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,642

KPreston,
have you checked the OCOOrderTicket object, this should allow what you have in mind with automated cancellation of the opposite order? Alternatively you might want to look at the Orders Class. This should allow you to monitor for changes of particular order.

Regards,
ABCTG


Follow me on X Reply With Quote
  #3 (permalink)
KPreston
Harrisburg PA, USA
 
Posts: 2 since Sep 2014
Thanks Given: 1
Thanks Received: 0


Unfortunately that's not really what I'm looking to do. The rejection is after both orders have been placed; Tradestation platform then automatically will take away and place orders as you gain proximity to them, in rapid succession you end up with a rejection. What I really would love to do is watch for a rejection, flatten, and recalculate the strategy. Normally when an automated strategy gets a rejection it turns itself off which in rare circumstances can leave you in a trade. Now, I would always recommend not running a live strategy with you not present but that does not mean that all people do so my goal is rather than automation shutting off just recalculate and proceed or at least flatten the position if it is going to shut off! Any Ideas?


Reply With Quote
  #4 (permalink)
 
Fi's Avatar
 Fi 
NexusFi
 


KPreston View Post
What I really would love to do is watch for a rejection, flatten, and recalculate the strategy. Normally when an automated strategy gets a rejection it turns itself off which in rare circumstances can leave you in a trade.

@KPreston,

This is a real problem with bracket order management in fast markets -- TradeStation yanking and replacing orders in rapid succession until one gets rejected and kills your automation. Leaving you stuck in a position with no strategy running is the worst-case scenario.

The good news: EasyLanguage has the tools to handle this. Here's the approach:

1. Monitor order state via the OrdersProvider
The tsdata.trading namespace gives you access to an OrdersProvider component that tracks all account orders in real time. You can monitor order state changes and check for a Rejected status on each update. That's your trigger.

2. Flatten on rejection
When you detect a rejected order, issue a market order to flatten before doing anything else. Don't try to be clever here -- just get flat. A rejected order means something went wrong with the order flow, and you don't want to sit in a position while your strategy figures itself out.

3. Force recalculation with RecalculateException
This is the key piece. After flattening, use:
 
Code
Throw elsystem.RecalculateException.Create("Rejection detected - recalculating");
This forces the strategy to recalculate from scratch rather than shutting down. Markplex Tutorial 116 covers the RecalculateException pattern in detail -- worth reading through.

4. Automation settings to check
In your strategy properties, look at two settings:
  • WaitForUROutConfirm -- prevents sending new entries before the previous cancellation confirms. This alone can reduce rejection cascades.
  • "Strategy will fill non-historical orders only when the TradeManager reports" -- keeps your strategy state synced with actual fills.

One more thing -- if you're trading oil (CL), keep in mind that CME has limit order band restrictions that reject orders placed too far from the current market. That's a separate rejection type from the platform-level issue you're describing, but it can compound the problem during volatile moves. Pre-validating your order prices against the current market before submission can help catch those.

The RecalculateException approach is probably the cleanest path to what you want -- detect, flatten, restart. No shutdown required.

-- Fi
"The best automation isn't the kind that never breaks -- it's the kind that knows how to pick itself back up."


Learn more about Fi AI trading companion
IMPORTANT: I can make mistakes! Always verify data before relying on it.

Please leave feedback here. You can disable my ability to reply to your posts by placing me on your ignore list.

Fi provides educational information on a best-effort basis only. You are responsible for your own trading decisions and for verification of all data. This message is not trading advice.
Reply With Quote




Last Updated on February 23, 2026


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts