Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

No OnOrderUpdate() callback for TDA OCOs

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

    No OnOrderUpdate() callback for TDA OCOs

    Hello,

    Is there a known technical limitation when submitting OCO orders to TDA from an Unmanaged NinjaScript strategy?

    The strategy's OnOrderUpdate()/OnExecutionUpdate() doesn't appear to be getting called for those OCO orders after they are submitted.

    Thanks.
    Trade Above, LLC
    NinjaTrader Ecosystem Vendor - tradeabove.com

    #2
    Hello, thanks for writing in. We have not had any other users report this issue. I will test a script on the market open tomorrow to see what I get. Ill report back here once I have completed the test.

    Kind regards,
    -ChrisL

    Comment


      #3
      Thanks Chris.
      Trade Above, LLC
      NinjaTrader Ecosystem Vendor - tradeabove.com

      Comment


        #4
        Hi, I am getting OnOrderUpdate events on the unmanaged orders using the TDAmeritrade connection. The test I did is simple order submission in OnBarUpdate on the first real-time bar, then I print the order details in OnOrderUpdate and OnExecutionUpdate.

        Comment


          #5
          Thanks for testing this, Chris. Did your test include OCO orders? My scenario is a market order entry and a stop/target OCO pair. These are live (non-sim) orders.

          I've attached an image to show what I'm seeing. The Submitted state seems to be the last thing processed by the strategy's OnOrderUpdate() for OCO orders. Subsequent order updates are showing in the NT log file with name "External" and not being processed by the strategy.

          ​​
          Attached Files
          Trade Above, LLC
          NinjaTrader Ecosystem Vendor - tradeabove.com

          Comment


            #6
            Hi, I am using OCO. I have attached my test script that submits two buy orders above and below the market in OCO if you would like to try it out. Make sure you are also running the latest version of NinjaTrader R27.1. You can download it here:
            Access step-by-step NinjaTrader platform training for desktop, web, and mobile. Explore video tutorials and practical guides to help you confidently use trading tools and features.


            Attached Files

            Comment


              #7
              Thanks for this. Were you using a live TD Ameritrade account for your test?
              Trade Above, LLC
              NinjaTrader Ecosystem Vendor - tradeabove.com

              Comment


                #8
                Hi, I am using a live TD Ameritrade account. If possible, try testing on a different computer to see if it's your development environment causing the issue. Test both your script and my script.

                Comment


                  #9
                  Thanks for confirming.

                  I have limited access to this trading environment, so I only recently was able to run your test script. Unfortunately it was the same result: Summitted is the last order state processed by the strategy's OnOrderUpdate() for the OCO orders. These orders then show up in the logs with name "External".

                  (Note: I tried both my script and your script with the TDA connection but Sim101 instead of the live account, and had no issues. So the issue is exclusively with live OCO orders submitted to TDA)

                  I appreciate any assistance with next steps to identify the problem. Thanks.
                  Trade Above, LLC
                  NinjaTrader Ecosystem Vendor - tradeabove.com

                  Comment


                    #10
                    Hello, thanks for the follow up. I must recommend you test on a clean installation to see what might be causing this. If possible test on a different computer. If you are using a virtual machine or VPS please test on real hardware.

                    To preform a complete re-installation, and save your old installation:

                    HTML Code:
                    Navigate to your Documents folder > Right-click on the 'NinjaTrader 8' folder > Rename > rename the folder to 'NinjaTrader 8 OLD'. DO NOT delete this folder.
                    
                    Uninstall NinjaTrader within Windows Control Panel.
                    
                    Navigate to C:\ > Program File (x86) > Delete the 'NinjaTrader 8' folder if it exists
                    
                    Reboot your PC.
                    
                    Once these steps are completed, download and install NT8 from the link below:
                    
                    https://ninjatrader.com/GetStarted​
                    NinjaTrader looks for a folder called "NinjaTrader 8" in the documents, so reversing this process will revert back to your old installation.
                    Last edited by NinjaTrader_ChrisL; 01-24-2023, 03:19 PM.

                    Comment


                      #11
                      Chris, that did the trick! Thank you for your help.

                      This was on a physical machine (not VPS) and already had a very new install of NT. Btw, when I did the reinstall I used the old NT Config file.

                      Can you shed any light on what could be the cause? Is there anything that can be done to prevent this in the future?
                      Trade Above, LLC
                      NinjaTrader Ecosystem Vendor - tradeabove.com

                      Comment


                        #12
                        Hi, Im glad the new installation helped this issue. I could not say what the issue was as I was not able to reproduce it at all, and we did not have any others writing in about it. It could have been specific to your development environment.

                        Comment


                          #13
                          Your suggestion to reinstall made me wonder if you had an inclining based on previous experience with a similar issue. I'll also note that this was a very clean environment, and the only development work done in the environment was compiling the source code of this strategy (dev was done on another PC). NT had been installed for this purpose only a few weeks prior.

                          Thanks again.
                          Trade Above, LLC
                          NinjaTrader Ecosystem Vendor - tradeabove.com

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by NullPointStrategies, Today, 05:17 AM
                          0 responses
                          52 views
                          0 likes
                          Last Post NullPointStrategies  
                          Started by argusthome, 03-08-2026, 10:06 AM
                          0 responses
                          130 views
                          0 likes
                          Last Post argusthome  
                          Started by NabilKhattabi, 03-06-2026, 11:18 AM
                          0 responses
                          70 views
                          0 likes
                          Last Post NabilKhattabi  
                          Started by Deep42, 03-06-2026, 12:28 AM
                          0 responses
                          44 views
                          0 likes
                          Last Post Deep42
                          by Deep42
                           
                          Started by TheRealMorford, 03-05-2026, 06:15 PM
                          0 responses
                          48 views
                          0 likes
                          Last Post TheRealMorford  
                          Working...
                          X