Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8-TDA orders submitted never get an updated status

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MarketMaker
    replied
    NinjaTrader_PatrickG , Do you have an update on the new TDA API? Can you give us an estimated release date? Do you you have a better understanding of why NT and TDA does not work in the AM? Today, it didn't start working until 12:30pm EST.

    Thanks for your response.

    Leave a comment:


  • NinjaTrader_PatrickG
    replied
    MarketMaker , I believe I may know what is occurring with your OCO orders. Here are some current expectations/limitations with OCO through TDA API:
    • When submitting orders within an OCO group, the orders must be submitted to TDA as a pair
      • This means you cannot submit a single OCO-tied stop or target, you always must submit both (stop + target) together or the TDA adapter will not send them to TDA
      • The adapter has internal logic to wait for the other order submission before sending
    • After submission, those orders will no longer be modifiable and no new orders using that OCO will be allowed
    • To make a change to an OCO grouped order it must be cancelled and resubmitted
    • ATM functionality which would modify submitted stops and targets on TD Ameritrade accounts are therefore not supported.
    This is mentioned in the disclaimer which appears in the connection guide and as a pop up when you configure the connection:
    bertochi , please send me your log and trace files so that I may look into what occurred.
    • You can do this by going to the Control Center-> Help-> Email Support
    • Ensuring 'Log and Trace Files' is checked will include these files. This is checked by default.
    • Please reference the following ticket number in the body of the email: 2463730 ATTN PatrickG

    Leave a comment:


  • bertochi
    replied
    Hello @MarketMaker, same experience here. First 2 hours of the day the API simply does not work, as described on earlier posts. Orders do not get their status updated once filled. I have not tried my luck with OCO orders. There is the other issue as well that even when orders are updated mostly in the afternoon hours, some positions are not getting updated and end up out of sync. Somehow the method "onposition update" that should be triggered after "Onexecution update" is not being executed, hence positions not getting updated.

    Leave a comment:


  • MarketMaker
    replied
    Just wanted to update everyone. Trading is fine, excluding the mornings.

    bertochi Do you have any success with OCO orders with TDA? I've tried a ton of different code options, but I haven't had any success. Target and stop orders cancel each other out, leaving only one or the other. The last order issued is the only one that sticks. Thanks for any feedback or ideas.

    Leave a comment:


  • MarketMaker
    replied
    bertochi I agree. I did many trades today and many of them were fine. However, I had 5 trades that had this new error: "The order could not found. Please check its status."

    When my strategy attempts to move an existing stop, it occasionally hits this error. It's not my code because stops move consecutively successfully (trailing stop), and all of a sudden this error happens and breaks the trade. I'm not sure why the order is not found, but it might be related to slow confirmations from TDA and NT not having the order ready to update.

    This inconsistency is frustrating. I hope this gets sorted out with the new API.

    Leave a comment:


  • bertochi
    replied
    Update. 31/03 at 13:30hs Eastern Time.
    - Same behaviour as when we started this post. Orders would not get an updated status during the first hour of the day.
    - From around 12hs Eastern Time, orders get updated as they should.
    - I am also tracking the positions after orders are sent, and not all positions are getting updated after a trade has been executed. For example, Strategy position is showing as long, but account (broker) position is showing as flat. Upon checking the log, it appears the line that should read like "Position, Instrument xxx Account xxx Price xxx Quantity xxx Market position=Long Operation=Operation_add IS MISSING... I have added code inside my strategies so that if the strategy goes out of sync for more than 180 seconds, it should trigger an alert and I will take care of that by restarting NT.

    Leave a comment:


  • MarketMaker
    replied
    Just wanted to report that today was an error-free day for me. All trades were successful! Hoping this continues.

    Leave a comment:


  • bertochi
    replied
    @MarketMaker Agree. There was a slow transition of the order status in the first 30 minutes of trading, but they were not stuck as in previous days, and it cleared out from 10am Eastern. This is consistent with the idea that it "might", as a guess, be a TDA server issue, a different timing of response, or similar, to explain this behaviour we had to cope with. I hope this gets properly addressed.

    Leave a comment:


  • MarketMaker
    replied
    bertochi I've not seen any new issues with TDA today. In fact, this is the first morning in days that I've been able to trade with NT. So far so good today.

    Leave a comment:


  • bertochi
    replied
    To all TDA users, please be advised there is another issue with the TDA-API other that the orders issue we are tracking here, but still related to the API. I have created a separate post for such issue. If interested you can read about it here:

    This is another issue with TDA that happens at random. "Almost" every day it happens upon launching NT for the first time on that day, but it can also happen during other times of the day. NT connects successfully to TDA price feed, but not to your live account. Due to this bug, all your positions show as 0. If you

    Leave a comment:


  • MarketMaker
    replied
    bertochi I agree that this might be a TDA problem. It feels like they're purposely disabling, slowing down, or de-prioritizing API access during mornings. It seems like the NT developers could just ask TDA what's going on in the mornings. Maybe TDA wants to limit API access to avoid overloading their systems during heavy turbulence?

    My worry is that when the new NT API is released, this problem will still exist. I hope that NT developers and support can get clear answers from TDA now, so that when the new API is released, there's not yet another delay til resolution. Can we not try to understand the problem now in parallel with getting the API released? Hoping the new API fixes the issue doesn't seem like the most logical way forward, unless we understand the problem first and have a clear solution to address.

    A week as passed without an update from NinjaTrader_PatrickG. Hope he updates us soon!

    Leave a comment:


  • bertochi
    replied
    Hi, I am not a pro-programmer but here are some ideas to tackle and workaround these NT-TDA issues until they are resolved. In the current condition, NT is broken and seriously compromised when used with TDA. Manual supervision of NT is necessary at all times.
    ================================================== ================================
    // IORDER DECLARATIONS
    private Order enterLong = null;
    private Order enterShort = null;
    private Order exitLong = null;
    private Order exitShort = null;
    // BOOL VARIABLES TO KEEP TRACK OF ORDER FILLING
    private bool bc_filled = false; //BUY TO COVER = EXIT SHORT
    private bool long_filled = false;
    private bool sell_filled = false; //SELL = EXIT LONG
    private bool short_filled = false;
    // OTHER VARIABLES TO HELP DETECT ANY ORDER ISSUES
    private DateTime = entry_time;

    CODE INSIDE ONBARUPDATE WHEN ENTERING A TRADE:
    =============================================
    entry_time = DateTime.now; //SET THE ENTRY TIME / USED ON LIVE STRATEGY WHEN SENDING AN ORDER

    bc_filled = false; // WHEN SENDING AN EXIT SHORT ORDER
    long_filled = false; // WHEN SENDING A LONG ORDER
    sell_filled = false; // WHEN SENDING AN EXIT LONG ORDER
    short_filled = false; // WHEN SENDING A SHORT ORDER

    CODE INSIDE ON EXECUTION:
    ========================
    //IF ANY OF 4 ORDER TYPES IS FILLED -> UPTATE THE FILLED BOOL VARIABLE TO "filled"

    if (execution.Order != null && execution.Name == "EXIT SHORT = BUY TO COVER" && execution.Order.OrderState == OrderState.Filled) {bc_filled = true;}
    if (execution.Order != null && execution.Name == "EXIT LONG = SELL" && execution.Order.OrderState == OrderState.Filled) {sell_filled = true;}
    if (execution.Order != null && execution.Name == "LONG CONDITION TRIGGERED" && execution.Order.OrderState == OrderState.Filled) {long_filled = true;}
    if (execution.Order != null && execution.Name == "SHORT CONDITION TRIGGERED" && execution.Order.OrderState == OrderState.Filled) {short_filled = true;}

    AT THE START OF ONBARUPDATE:
    ===========================

    //IF ANY OF 4 ORDER TYPES IS NOT NULL

    if ( (enterLong != null || enterShort != null || exitLong != null || exitShort != null) && //ANY ORDER HAS BEEN TRIGGERED

    (bc_filled == false || long_filled == false || sell_filled == false || short_filled = false) ) //ANY OF THE 4 BOOLS IS NOT TRUE = NOT FILLED YET

    {

    if ((DateTime.Now - entry_time).TotalSeconds > 40) // LIVE // A MARKET ORDER HAS NOT BEEN FILLED AFTER 40 SECONDS

    {
    string msg = Instrument.MasterInstrument.Name+" | Order not filled after 40 seconds";
    Log(msg, LogLevel.Error);
    }
    else if ((DateTime.Now - entry_time).TotalSeconds > 80) // LIVE // A MARKET ORDER HAS NOT BEEN FILLED AFTER 80 SECONDS

    {
    string msg = Instrument.MasterInstrument.Name+" | Order not filled after 80 seconds";
    Log(msg, LogLevel.Warning);
    }
    else if ((DateTime.Now - entry_time).TotalSeconds > 120) // LIVE // A MARKET ORDER HAS NOT BEEN FILLED AFTER 120 SECONDS

    {
    string msg = Instrument.MasterInstrument.Name+" | Order not filled after 120 seconds";
    Log(msg, LogLevel.Alert);
    // TRIGGER AN EVENT OF YOUR CHOICE //
    SetState(State.Terminated);
    }

    }
    Last edited by bertochi; 03-28-2020, 11:23 AM.

    Leave a comment:


  • bertochi
    replied
    Today 27/3, still the same pattern that orders do not get their filled status even though they are filled in the first hours of trading.
    The difference today was that I've seen the orders transition from "submitted" to a "working" status, but did not get any further updates from that status.
    They started working fine from around 11hs Eastern.
    Dear @NinjaTrader_PatrickG, I've got the feeling this is something to do with the TDA servers, that's why I suggested if your team could discuss the issue with the TDA API guys, maybe they could figure it out. This is all a guess as that is all we can do ourselves, as users, from this side of things.
    Thank you

    Leave a comment:


  • MarketMaker
    replied
    Today 3-27, morning was a bit different. Still not working, but different behavior. When I started my strategies, it seemed like they weren't able to get the data it needed to run normally. I was connected to TDA, but didn't see any progression or typical activities in my strategies. I shut it down and restarted in the afternoon and everything worked as normal.

    Leave a comment:


  • bertochi
    replied
    @MarketMaker Same here.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by Jimmyk, 01-26-2018, 05:19 AM
6 responses
834 views
0 likes
Last Post emuns
by emuns
 
Started by jxs_xrj, 01-12-2020, 09:49 AM
6 responses
3,290 views
1 like
Last Post jgualdronc  
Started by Touch-Ups, Today, 10:36 AM
0 responses
10 views
0 likes
Last Post Touch-Ups  
Started by geddyisodin, 04-25-2024, 05:20 AM
11 responses
62 views
0 likes
Last Post halgo_boulder  
Started by Option Whisperer, Today, 09:55 AM
0 responses
8 views
0 likes
Last Post Option Whisperer  
Working...
X