Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Connection lost with TDA loading multiple strategies - anyone solve ever?

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

    Connection lost with TDA loading multiple strategies - anyone solve ever?

    I googled the issue, and there are countless threads and complaints regarding this, and for as long as I've been using NT (7, or 8) since 2015 I have always had the same connection loss from TDA.

    Sometimes it happens right away when loading a strategy, or maybe 2-3 minutes into it running already, sometimes a few hours, sometimes maybe a full day, and sometimes (if very lucky) a full 72 hours or more.

    Just like others have mentioned, I've tried different computers, different ISP - Verizon Fios with 500Mbps and Xfinity with 200Mbps, even different cable modem box (one that's provided and own purchased). It's the same with NT7 or NT8.

    Is there a LIMIT on how many requests NT8 can make from TDA over given amount of time? Is it based on the initial number of requests, and what's that size then?

    The ONLY time that I don't almost immediately get "connection lost", is if I a) don't load any strategies, and just use it for charting b) load one strategy at a time; if I'm running hundreds or thousands of strategies that's not really an option.

    I can confirm that connection is NOT lost loading one strategy at a time.

    #2
    I am not aware of an API limitation for TD Ameritrade which would cause a failure when starting many strategies.

    Is this behavior easily reproduced? If so, what exact steps would I take? Please be as specific as possible.

    Additionally, I'd like to look into your log and trace files so I can see more details about your installation of NinjaTrader. 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: 1794486 ATTN Patrick G

    Comment


      #3
      hey there,

      I've sent it out... But this is what I see in trace file:

      "An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host"

      It looks like TDA is dropping me, so my best guess is that there's a limit of requests we're allowed to make per given time frame.

      Comment


        #4
        Follow up

        So....
        ""An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host""

        ^^^ This means exactly what it means. TDA does not "support" Ninjatrader, and they don't allow automatic trading as such.

        It sucks, but you will get disconnected if you make too many requests... Your strategy should work for about 200 stocks (in total, 1 timeframe only), above that your connection WILL GET dropped.

        Also, to enable your strategy, you will have to enable 30 or so stocks a time max, but too many subsequent requests will ALSO get you dropped.

        Not sure what to do next with this information

        Comment


          #5
          Did you speak with TD Ameritrade about this directly? If so, could you forward me their response to your inquiries via email?

          Please email me at PlatfformSupport[AT]NinjaTrader[DOT]com so I may gather more information for documentation. Ideally, we'll be able to use the information you provide to improve the behavior of all TD Ameritrade connections.

          In your email, make sure to include a link to this forum post and '1794486 ATTN Patrick G'.

          Comment


            #6
            hey there,

            Update to the issue, since Trace file seems to give very specific points.

            It's a very sad update, however. I've seen reconciled with the fact that I cannot run strategies using TDA with Ninja as they have a limit on the number of simultaneous requests from each user - not clear on what that limit was, rep would not disclose or did not know..

            So I've translated my strategy on charts, so at the very least I could look at things myself, and get an easy and quick read looking at an instrument. However, the connection is being dropped even if I'm simply connected to them and using charts. Can you look into why this is happening, or is it completely up to TDA to disconnect all NT users?

            "
            2017-12-11 13:12:16:210 (My TD AMERITRADE Tda.Adapter.GetOrderHistoryAsync0: <?xml version="1.0"?><amtd><result>OK</result><orderstatus-list><account-id>868083572</account-id></orderstatus-list></amtd>
            2017-12-11 13:12:17:491 (My TD AMERITRADE) Tda.Adapter.StreamingDataCallback: IOException='System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
            at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
            at System.Net.Sockets.NetworkStream.EndRead(IAsyncRes ult asyncResult)
            --- End of inner exception stack trace ---
            at System.Net.ConnectStream.EndRead(IAsyncResult asyncResult)
            at NinjaTrader.Tda.Adapter.StreamingDataCallback(IAsy ncResult ar)'
            2017-12-11 13:12:17:491 (My TD AMERITRADE) Tda.Adapter.StreamingDataCallback: IOException InnerException='System.Net.Sockets.SocketException (0x80004005): An existing connection was forcibly closed by the remote host
            at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
            at System.Net.Sockets.NetworkStream.EndRead(IAsyncRes ult asyncResult)'
            2017-12-11 13:12:17:491 ERROR: The connection was forcibly closed by TDA.
            "

            Comment


              #7
              NinjaTrader does not automatically disconnect users for any reason. NinjaTrader behaves like a radio - it reports the information it receives from your connection.

              If the connection forces a disconnect, then this cannot be avoided. The error message at the end of your quote states that TDA has forced the connection to be closed.

              Comment


                #8
                Hey there,

                Yes it's always been an issue... Just wondering if there's something wrong with the way TDA connection is implemented. Otherwise, why even list Ameritrade as one of potential data providers.

                Thus my logical deduction - if there IS an actual agreement with TDA, it would have to be something with implementation of API.

                Comment


                  #9
                  hey there,

                  and don't get me wrong. I REALLY appreciate the fact that there even IS a system that is helping to equal the playing feed, by allowing for small algorithm creation, so that decision making is immensely improved. I just want to help find out what's causing TDA to always drop the connection to all NT users. This would be a direct conversation between the API provided from TDA, and whether NT is written in such a way that it's following their rules of engagement.

                  Thanks

                  Comment


                    #10
                    Originally posted by NinjaTrader_PatrickG View Post
                    NinjaTrader does not automatically disconnect users for any reason. NinjaTrader behaves like a radio - it reports the information it receives from your connection.

                    If the connection forces a disconnect, then this cannot be avoided. The error message at the end of your quote states that TDA has forced the connection to be closed.
                    And NT doesn't bother to reconnect...

                    Comment


                      #11
                      Originally posted by lmatiukas View Post
                      Hey there,

                      Yes it's always been an issue... Just wondering if there's something wrong with the way TDA connection is implemented. Otherwise, why even list Ameritrade as one of potential data providers.

                      Thus my logical deduction - if there IS an actual agreement with TDA, it would have to be something with implementation of API.
                      Dude - it's like falling on deaf ears here about TDA connection.

                      This NT8/TDA connection was supposed to be so great compared to NT7... and it's basically a complete fail.

                      The NT8 7am EST disconnects are beyond real(Mostly Tues/Thurs, but can happen other days of week at random).. NT7 stays on all week.

                      I can't even get an RTH chart to start in NT8 and they want to blame TDA.

                      Comment


                        #12
                        Sadness

                        Originally posted by sledge View Post
                        Dude - it's like falling on deaf ears here about TDA connection.

                        This NT8/TDA connection was supposed to be so great compared to NT7... and it's basically a complete fail.

                        The NT8 7am EST disconnects are beyond real(Mostly Tues/Thurs, but can happen other days of week at random).. NT7 stays on all week.

                        I can't even get an RTH chart to start in NT8 and they want to blame TDA.
                        I know you've commented on my posts before as I've been coding and having this issue from the first beta of nt8 - well over a year now...

                        I played around with nt7, but really got into nt8 since it uses an actual programming language. I have a simple, yet 90% accurate strategy, and ive been publicly posting entries to ensure transparency and honesty with own results. However I have to restart 10-20 times a day.

                        It's "quanttrading" on google groups. It's accurate, and I have major coding improvements in mind but I'm not sure what to do. NT7 translation for the code and indicators would take a ton of time, as I would have to learn "pig Latin", whilst I already speak fluent English. Also what if NT7 stops receiving support, not to mention it's single core usage only. They're clearly keeping it around, because there are issues with nt8, but they are being ignored to some extent.

                        I'm torn man, as I want to run and share also results easier.

                        Comment


                          #13
                          Originally posted by lmatiukas View Post
                          I played around with nt7, but really got into nt8 since it uses an actual programming language. I have a simple, yet 90% accurate strategy, and ive been publicly posting entries to ensure transparency and honesty with own results. However I have to restart 10-20 times a day.

                          It's "quanttrading" on google groups. It's accurate, and I have major coding improvements in mind but I'm not sure what to do. NT7 translation for the code and indicators would take a ton of time, as I would have to learn "pig Latin", whilst I already speak fluent English. Also what if NT7 stops receiving support, not to mention it's single core usage only. They're clearly keeping it around, because there are issues with nt8, but they are being ignored to some extent.
                          Well - it's still C#, same language to me. All this brush stuff is rather overkill to me in NT8.

                          I only use NT8 for market replay - yes - it's very fast - and now pretty stable after they knocked out my bugs.

                          I depend on TDA for my strategy. Kinetick doesn't get the same lame feed TDA does - and therefore my strategy won't work the same.

                          At worst - I have code from TDA that does know when the STREAM has stopped - unlike NT8 which has NO CLUE about a stream disconnect. I've tested it. I'll have to hack that into my code and get it working in NT8 as an outside provider thingy when the time comes. NT7 should last through Win7 EOL, and maybe +1 year.

                          So yeah, I'm angry, upset. disappointed - I'd like to switch to NT8 live... but it's not there yet for me.

                          If I remember correctly - NT6.5 officially died when there was some CME upgrade to add some flag to the trade about whether or not it was an algo or via human input.

                          Comment


                            #14
                            Thanks for the feedback.

                            I'd like to summarize the current status of this as it seems there is a misunderstanding that we've written of the TD Ameritrade connectivity issue in general. This is far from the case.

                            lmatiukas, the Development Team has also analyzed your trace files and, as we know, found that the connection is being dropped. NinjaTrader is appropriately handling the connection drop, but why the connection drop is happening in this scenario is unknown.

                            The Development Team is discussing connection limits with TD Ameritrade to understand why this is happening.

                            I'll update you via this thread or via the original email conversion (ticket #1799852) we had regarding this when I have more information.

                            Thanks in advance for your patience.

                            Comment


                              #15
                              Looking forward to the updates.

                              I suppose I'll table NT8 for now, until this is sorted, and see if I can learn NT7 and reprogram my indicators and strategies. I can see right away, however, that it doesn't drop the connection. Running NT7 and NT8 side by side makes it that much more evident, as TDA constantly disconnects NT8.

                              Thanks

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by jeronymite, 04-12-2024, 04:26 PM
                              3 responses
                              44 views
                              0 likes
                              Last Post jeronymite  
                              Started by Barry Milan, Yesterday, 10:35 PM
                              7 responses
                              20 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Started by AttiM, 02-14-2024, 05:20 PM
                              10 responses
                              179 views
                              0 likes
                              Last Post jeronymite  
                              Started by ghoul, Today, 06:02 PM
                              0 responses
                              10 views
                              0 likes
                              Last Post ghoul
                              by ghoul
                               
                              Started by DanielSanMartin, Yesterday, 02:37 PM
                              2 responses
                              13 views
                              0 likes
                              Last Post DanielSanMartin  
                              Working...
                              X