Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Automation / Connection problem for NT8 after (auto restart) of TWS

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

    #16
    Hi Jim, Thank you for your answer.

    Funny you mentioned "You can also configure email alerts to alert you if there has been a connection loss to your broker/data provider. You would first set up an Email Share Service, and then set Tools > Options > General > "Email log alert messages" to the email address you would like to have emails sent to."

    I did exactly that, but received only more errors... (not able to verify account)
    To configure an email I need to be able to configure more, like;
    - server for outgoing email (SMTP), port nr, password, account, require verification y/n, etc.
    - server for incoming email (POP), port nr, password, account, require verification y/n, etc.

    My suggestion would be to either to offer connection to your own email server, so users only have to provide simple input (from, to, subject)
    Or provide a more robust email client configuration option and make the settings more accessible (it is quite hidden).

    Today I tried to install the older TWS / Gateway which cannot be the way to go. (does not work for me).

    I will look into having separate accounts for different strategies, I have 2 run at the same time which might cause the inability to sync correctly.

    Comment


      #17
      Pffft

      I thought, "well ok let's use a Gmail account" to inform myself of the status from NT8.
      After installation; no way I get the test email to work... Do I get a warning from Google "someone tried to use your email account from an UNSAFE email client!!" The client is blocked.

      This should wake up your development department and create an application that is 2020 compatible.
      Compliments on the core NT8, but please support us on the communication part (3rd party connection, email, other platforms (MacOS, Linux))

      Comment


        #18
        Hello Rob2011,

        I'd like to keep this topic on track in case others have specific feedback to give regarding IB Gateway and allowing NinjaScript strategies to stay running overnight during the week.

        I'll provide some advice here, but if you have additional questions, please reach out to me at platformsupport [at] ninjatrader [dot] com with the text "Attn Jim 2393294" and a link to this thread so we can keep this thread in focus.

        Email providers are much more secure with allowing applications to send emails on your behalf.

        Setting up email alerts with Gmail requires enabling Two Step Authentication on the Gmail account, and then enabling an App password. You may then use your app password to login via NinjaTrader. Once this is set, please then test sending an email message.

        1. Two Step Authentication for Gmail - https://myaccount.google.com/signino...enroll-welcome
        2. Set up an App Password for Gmail - https://security.google.com/settings...y/apppasswords

        The links above are publicly available.

        We look forward to assisting.
        JimNinjaTrader Customer Service

        Comment


          #19
          NT Staff: Have you guys considered using Interactive Brokers OMS? https://www.interactivebrokers.com/en/index.php?f=1186
          Your own server would maintain a single TWS connection to IB. NT Platform would send orders to your server and your server would route to IB.
          Here's an example of how another company does it https://reports.dastrader.net/generalupload4.aspx, and they also have a Rider Agreement https://reports.dastrader.net/IBCO.pdf

          Comment


            #20
            Hello hurleydood,

            Thanks for your feedback.

            The issue presented in this thread involves connections to TWS automatically being closed by Interactive Brokers where NinjaTrader cannot automatically reconnect and re-enable strategies. (In This Thread, we advise using IB Gateway with Connection Loss Handling set to Keep Running to keep automated strategies running.)

            NinjaTrader will need to receive price information in addition to being able to route orders to have a strategy run. As I gather here, the issue with TWS disconnects would still be relevant, and as I also gather, the connection NinjaTrader makes to TWS would then be what is used to bring data in to populate charts and drives other parts of the platform. Individual client data enablements would not be usable since NinjaTrader would be connecting to its own TWS connection.

            If there is something else I am missing here, please let me know and I'll be sure to send this suggestion in to the Development team.
            JimNinjaTrader Customer Service

            Comment


              #21
              I have now un-installed the Interactive Broker SW and installed the older version dictated in the NT8 connection manual.
              I am focussing only on the gateway connection to minimize disconnections.

              First impression is ok, but it seems the TWS gateway is losing more frequent its connection with the historical data database.
              No need to contact Interactive Broker as they will advise to upgrade to latest version..

              I will keep you posted with results of my simulated autotrading adventure (24/5 on MES futures).

              btw I installed IFTTT to inform me when connection is lost or order placed but without succes, anyone else suggestion for a watchdog system?

              Comment


                #22
                Hello Rob2011,

                Our recommendation within NinjaTrader would be to override OnConnectionStatusUpdate() to see when there has been a connection loss. This could be used to control logic to prevent order submissions if the connection to the order routing has been lost.

                I may also suggest testing with a high value for Disconnect Delay Seconds when setting Connection Loss Handling to Keep Running, so if there is any brief disconnection, the strategy can wait long enough to stay running.

                I'll leave the thread open for other Community Members input on other applications that may be used.
                JimNinjaTrader Customer Service

                Comment


                  #23
                  Hi Jim,

                  Thank you for the support. What kind of code are you suggesting to use to override OnConnectionStatusUpdate() ?

                  After 24hours running I experienced the following:

                  Connection lost for short time (see screenshots).
                  Luckily no error alert in NT8 and connection is still active (yes increased the values but not required in this case).

                  But my strategies are disabled...
                  My setting for the strategies was "Recalculate", I will now test with "Keep running".

                  Any other suggestions?

                  PS still looking for a proper watchdog (IFTT not working yet).
                  Attached Files
                  Last edited by Rob2011; 02-12-2020, 12:54 PM.

                  Comment


                    #24
                    Hello Rob2011,

                    My recommendation to keep the strategy running with IB Gateway was to use Keep Running with a large value for Disconnect Delay Seconds.

                    As for OnConnectionStatusUpdate(), the code in the Help Guide will show how you can use it to detect connection losses to the price server and/or order routing server. You could flip a bool if the connection to the order routing server is lost to prevent the strategy logic from submitting orders. This would be similar to what is described in our halting strategy examples.

                    OnConnectionStatusUpdate - https://ninjatrader.com/support/help...atusupdate.htm

                    Halting strategy logic examples - https://ninjatrader.com/support/help...nce_user_d.htm

                    We look forward to being of any further assistance.
                    JimNinjaTrader Customer Service

                    Comment


                      #25
                      Hi Jim,
                      It seems to work like this :-) short connection lost has no (negative) effect on my configuration which continues to run fine.
                      I will implement your "OnConnectionStatusUpdate" suggestions and share my experience after a week or 2.

                      Comment


                        #26
                        The latest update NT8 works great with the latest TWS from Interactive Brokers.

                        Thank you Ninjatrader for the support and development :-)

                        Comment


                          #27
                          Originally posted by Rob2011 View Post
                          The latest update NT8 works great with the latest TWS from Interactive Brokers.

                          Thank you Ninjatrader for the support and development :-)
                          Do you mean TWS or IB Gateway connection to NT8?

                          Comment


                            #28
                            Hello chingus,

                            In this thread we discuss using IB Gateway with ConnectionLossHanlding set to Keep Running and DisconnectDelaySeconds set to a high value to keep the strategy running overnight throughout the week. (Weekend maintenance disconnects will still take place.)

                            Let us know if you have any questions.
                            JimNinjaTrader Customer Service

                            Comment


                              #29
                              Originally posted by Rob2011 View Post
                              The latest update NT8 works great with the latest TWS from Interactive Brokers.

                              Thank you Ninjatrader for the support and development :-)
                              Thanks for your hint!
                              What are you using in combination?
                              NT8 + TWS [OR] NT8 + IB Gateway?
                              Could you please provide Application-Version numbers, that are you using in combination?
                              This would help me really out!!! :-)

                              With best regards,
                              Peter

                              Comment


                                #30
                                Hello Peter,

                                The latest version of NinjaTrader can be found here - https://ninjatrader.com/PlatformDirect

                                The version of TWS and IB Gateway that we recommend can be found on our Connection Guide. In Release 22, we moved from TWS/IB Gateway 973.2 and now recommend TWS/IB Gateway 978.1.

                                Connection Guide - https://ninjatrader.com/ConnectionGu...nnection-Guide

                                We look forward to assisting.
                                JimNinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by pmachiraju, 11-01-2023, 04:46 AM
                                8 responses
                                148 views
                                0 likes
                                Last Post rehmans
                                by rehmans
                                 
                                Started by mattbsea, Today, 05:44 PM
                                0 responses
                                5 views
                                0 likes
                                Last Post mattbsea  
                                Started by RideMe, 04-07-2024, 04:54 PM
                                6 responses
                                33 views
                                0 likes
                                Last Post RideMe
                                by RideMe
                                 
                                Started by tkaboris, Today, 05:13 PM
                                0 responses
                                5 views
                                0 likes
                                Last Post tkaboris  
                                Started by GussJ, 03-04-2020, 03:11 PM
                                16 responses
                                3,283 views
                                0 likes
                                Last Post Leafcutter  
                                Working...
                                X