Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Connection best practices (IB, Kinetick)

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

    Connection best practices (IB, Kinetick)

    I've been using NT with IB and Kinetick data feeds for almost a year now, and I repeatedly experience annoying issues. I tried to solve these by trial and error, but the problems occur randomly, so it's kinda difficult/time consuming to get to the bottom of it. So I decided to start this thread, in hopes that we collectively can put together some best practices and identify scenarios/configurations that should be avoided.

    Issues that I'm experiencing:
    1) Price connection is lost, which turns off the strategy. Very annoying and potentially expensive problem. I seem to be experiencing this problem more frequently in the past 1-2 months.
    Questions:
    - does the strategy exit even if a secondary price connection is lost? Just a few days ago my strategies stopped, and according to the Log it was due to Kinetick, even though Kinetick wasn't my primary data feed connection
    - what is the recommended settings on the Strategy configuration tab to avoid these problems? Is there any downside using extreme parameters to avoid the strategy being turned off ever?

    2) Historical data backfill
    Occasionally my strategies stop loading historical data, even though the data feed/price connection is working. I haven't been able to narrow down what's causing this problem. I tried all combinations of IB and Kinetick primary feed/historical backfill, but so far wasn't able to find a reliable solution.
    What is the best, most reliable configuration with IB and Kinetic? Should IB be the primary data feed, should IB be used to backfull historical, or should Kinetick be used for that?

    3) Incorrect execution with Renko/LineBreak chart type, using Kinetick
    I've been experimenting with strategies that run on Renko/LineBreak chart types, and this seems to be broken with Kinetick: execution is delayed by 1 bar, i.e. it won't get executed at the beginning of the new bar that follows a bar that triggered a strategy action, but instead it will be executed at the end of the 2nd bar (or the beginning of the 3rd bar, I'm not sure which, didn't spend much time finding that nuance out).
    If I use IB for primary data feed, this is not an issue at all. You can probably all reproduce that, I tried it on two separate versions/installations with the same results.

    Any tips and suggestions are welcome! Thanks.

    #2
    Hello mic414.

    Thank you for your post.

    The strategy will disable upon a disconnect based on the settings under Tools > Options > Strategies > NinjaScript: http://www.ninjatrader.com/support/h...tegies_tab.htm

    If you are using settings that will allow for excessive disconnects and your strategy does not re-calculate on re-connect you could be potentially be in an undesired state for the strategy as far as the position and orders. There is no recommended setting, as each user will vary on their preference.

    Can you advise how you discovered the historical data was not being loaded for your strategy?
    Once again the configuration is up to the user. In most cases users use Kinetick either first for real-time and historical data or second for historical data and disable the historical data option from Interactive Brokers. Please visit the following link for more information: http://www.ninjatrader.com/support/h...onnections.htm

    For the Renko/LineBreak question, is this in backtesting? Otherwise, if it is real-time data - then set your CalculateOnBarClose option to False.

    Comment


      #3
      Thanks for the quick response.
      Regarding how I discover the lack of historical data: I notice that my strategy is not executing as expected, e.g. there was a big move in a stock, but my strategy didn't do anything. I then pull up the Real-time strategy performance, go to chart view, and then find that the data is not getting updated there.

      Renko/LineBreak: this occurs in realtime, not backtesting. The weird thing is that with the IB realtime feed, it works as expected, but when I make Kinetick the real-time feed provider, it lags. I haven't tried the CalculateOnBar option as with other chart types that would be incorrect, the strategy could whipsaw multiple times within a bar. I'll will try it though.

      Comment


        #4
        Hello mic414,

        Thank you for your response.

        Please let me know if you can point out the dates and times for the missed data for calculations. Please also provide the instrument and what Session Template you were using.

        Comment


          #5
          See attached a bitmap showing the data issue from today. This is not the backfill issue per se, but it is probably related. As can be seen on the screenshots, it appears that the Kinetick realtime data is lagging behind the current price data, as shows in IB. IB's price data was definitely correct, I checked other quote sources, too. In this case, the delay was about 2 minutes, but earlier today I had a case when I observed more that 5 minutes of delay. After I reloaded the historical data on the chart, it suddenly jumped forward, but it was still delayed by a minute or two.
          Attached Files

          Comment


            #6
            Hello mic414,

            Thank you for that information.

            NinjaTrader uses your PC clock for the time, please use the steps below to change your Time Zone and sync the PC clock, note to set the server to time.nist.gov.

            You can sync your PC clock by double clicking on the clock in the lower right corner of your desktop. Press 'Change time zone...' Set the Time zone and press 'OK'.

            Once you have done that, click on Internet Time tab set the server to time.nist.gov and then click Update. Your PC clock should now be updated.

            Comment


              #7
              I keep having constant disconnects from Kinetick. On average about 1 or 2 per week. When this happens my strategy eventually stops running. I do have it set in setting to keep running after disconnect, but after about an hour it gets shut down.

              My ninja runs on amazon aws. When I try to get support from Kinetick, the only reply I get check your ISP. I try to tell them that it is aws hosting, this is as stable as it gets, but still same reply.

              I use Kinetick for real time data and IB for trading. I used to only have IB and none of these issues happened. It must be something in Kinetick feed, may be if there is a quick loss of connection, it can not reconnect???

              Anyone have any idea? I am close to dropping them, though I really like the quality of their data.

              Thanks,
              redduke

              THIS IS FROM TRACE:

              2014-12-04 05:33:30:858 Connection to NinjaTrader data server lost: System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
              at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
              at NinjaTrader.Server.Client.Receive()
              at NinjaTrader.Server.Client.Loop()
              2014-12-04 05:33:30:858 ERROR: Connection to NinjaTrader historical market data server lost: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
              2014-12-04 05:33:40:873 Server.Client.Loop0-1: HDS2.NinjaTrader.com/31654 isReconnecting=True
              2014-12-04 05:33:40:998 Server.Client.Loop1-1

              ....... SOME OF ACCOUNT INFO

              2014-12-04 05:43:19:903 (KinetickReal) Kinetick.Adapter.connectionTimer: reconnecting to level1 by closing the socket, socket!=NULL
              2014-12-04 05:43:19:903 (KinetickReal) Kinetick.Adapter.L1Worker: restarting L1 thread after connection loss...
              2014-12-04 05:43:19:903 (KinetickReal) Cbi.Connection.ProcessEventArgs.ConnectionStatusEv entArgs ConnectionLost ConnectionLost NoError Unexpected disconnect from level1 data server. Trying to reconnect...
              2014-12-04 05:43:19:903 (KinetickReal) Kinetick.Adapter.connectionTimer: level1 socket closed
              2014-12-04 05:43:19:949 (KinetickReal) Kinetick.Adapter.L1Worker: started L1 thread
              2014-12-04 05:43:19:949 (KinetickReal) Cbi.Connection.ProcessEventArgs.ConnectionStatusEv entArgs Connected Connected NoError
              2014-12-04 05:43:19:949 (KinetickReal) Cbi.ConnectionStatusEventArgs.Process: ConnectionLost ConnectionLost

              ....... SOME OF ACCOUNT INFO

              2014-12-04 05:43:19:949 (KinetickReal) Cbi.ConnectionStatusEventArgs.Process: Connected Connected
              2014-12-04 05:43:19:981 (KinetickReal) Kinetick.Adapter.L1Worker: restarting L1 thread after connection loss...
              2014-12-04 05:43:19:981 (KinetickReal) Cbi.Connection.ProcessEventArgs.ConnectionStatusEv entArgs ConnectionLost ConnectionLost NoError Unexpected disconnect from level1 data server. Trying to reconnect...
              2014-12-04 05:43:20:152 (KinetickReal) Kinetick.Adapter.L1Worker: started L1 thread
              2014-12-04 05:43:20:152 (KinetickReal) Cbi.Connection.ProcessEventArgs.ConnectionStatusEv entArgs Connected Connected NoError
              2014-12-04 05:43:20:152 (KinetickReal) Cbi.ConnectionStatusEventArgs.Process: ConnectionLost ConnectionLost


              ......AND IT KEEPS REPEATING

              THIS IS FROM LOG:


              12/4/2014 5:33:30 AM|3|4|Connection to NinjaTrader historical market data server lost: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
              12/4/2014 5:33:40 AM|1|2|Connection to NinjaTrader historical market data server established.
              12/4/2014 5:43:19 AM|1|2|KinetickReal: Primary connection=ConnectionLost, Price feed=ConnectionLost
              12/4/2014 5:43:19 AM|1|2|KinetickReal: Primary connection=Connected, Price feed=Connected
              Last edited by RedDuke; 12-04-2014, 09:18 AM.

              Comment


                #8
                Hello RedDuke,

                Thank you for your post.

                The messages from the log detail you are losing connection to not only Kinetick's servers but also NinjaTrader's servers. NinjaTrader and Kinetick use different servers for there services. This would indicate a general disconnect issue and not a data provider specific issue.

                Please contact Amazon's AWS support team for further assistance with this item. Kinetick uses the following addresses and port to establish a connection, please make sure to provide this information the AWS team:
                • *.interquote.com
                • *.7ticks.com
                • Port 31654
                • Port 60020

                The Server IP ranges are the following:
                • Primary Server Farm IP Range: 66.112.156.x
                • Backup Server Farm IP Range: 66.112.148.x

                Comment


                  #9
                  Hi Patrick,

                  I have seen such disconnects for a long while. While I was using only IB all was reconnecting properly. The very short disconnects were happening usually between 12am-1am. Once I started using Kinetick, It does reconnect most of the time, but once or twice a week it chokes.

                  Thanks,
                  redduke

                  Comment


                    #10
                    Any other suggestions?

                    Thanks,
                    redduke

                    Comment


                      #11
                      Hello RedDuke,

                      Thanks for your reply.

                      How often do you restart NinjaTrader? It is recommended to restart NinjaTrader daily with Kinetick.
                      BrandonNinjaTrader Customer Service

                      Comment


                        #12
                        login failed

                        Hi Ninja Trader:

                        Im having the following error message every time I try to connect from my office (login failed: network to the order routing system is unavailable).

                        However when I do it from home there is no problem at all.

                        Any idea how can I fix this?


                        Thanks

                        Comment


                          #13
                          Hello jsefbgandara,

                          Thanks for your reply.

                          Who are you attempting to connect to?
                          BrandonNinjaTrader Customer Service

                          Comment


                            #14
                            Hi:

                            Im triying to connect to my account with continuum


                            Thanks

                            Comment


                              #15
                              Hello jsefbgandara,

                              Thanks for your reply.

                              This would be unrelated to this topic. I would recommend making a new tread for unrelated inquiries.
                              You would need to contact you IT department to ensure the following IP address and port is open.
                              IP = 208.48.16.130
                              port = 31654
                              BrandonNinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by PhillT, Today, 02:16 PM
                              1 response
                              1 view
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by Kaledus, Today, 01:29 PM
                              3 responses
                              9 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by frankthearm, Yesterday, 09:08 AM
                              14 responses
                              47 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by gentlebenthebear, Today, 01:30 AM
                              2 responses
                              13 views
                              0 likes
                              Last Post gentlebenthebear  
                              Started by PaulMohn, Today, 12:36 PM
                              2 responses
                              17 views
                              0 likes
                              Last Post PaulMohn  
                              Working...
                              X