Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Loss of connection preventing any further signals from strategy

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

    Loss of connection preventing any further signals from strategy

    I have been testing an automated tradig strategy on a paper account at IB using NT and it seems that when there is a loss of connection, the strategy never "syncs" back to the data to take any further signals.

    This has happened twice and the scenario was more or less identical. Today's scenario was exactly as follows:

    1- Run a strategy with NT connected to IB. Everything works fine and orders are triggered as expected.
    2- unplug the ethernet cable to simulate a loss of connection (log messages in NT Control Centre show loss of connection/data farm connection broken, but also indicate that the strategy will keep running as per my strategy setting).
    3- Close the lid of the laptop - computer goes to sleep.
    4- When I plug the ethernet cable back (after waking up the computer), the connection comes back but any further signals in the strategy as monitored from the charts are not taken (not also that the chart does not automatically fill back the "holes" in the bars (ie it seems to catch up from where it left off by aggregating all price moves during that time in one bar?).

    The strategy still says that it is running but it does not seem to be.
    What is the normal procedure to ensure that the strategy simply picks up from where it left off after a connection interruption?
    (ps I tried the different "sync" options in the settings but that does not seem to fix it)

    #2
    Hello JezzaNT,

    Thank you for your post and welcome to the NinjaTrader Support Forum.

    NinjaTrader does not support sleep modes or restoring from sleep modes.

    A computer going to sleep shuts down critical Windows processes, your network connection, and other files required by NinjaTrader.

    Once the sleep mode is restored, not all of these are restarted, and in your case the live market data connection is not restored.

    If you plan on using Sleep mode, please close NinjaTrader before entering a sleep state.

    Please let me know if I may be of further assistance.

    Comment


      #3
      Hi Patrick,

      Thanks for the quick and useful answer.

      I cant be 100% sure but I seem to remember that the previous case of such scenario happening, I'd left my computer running/trading overnight. When checking the chart upon waking up (me not my computer!), I noticed that the there was an open position that was left open and should have been closed hours before. The only thing that seemed to happen in between the entry and the "would-have-been" exit is a loss of connection.
      If I have "Keep Running" as an option for the strategy, should this behaviour occur? (ie I would expect that if the computer does not go into sleep mode, the strategy should keep executing signals when the connection comes back?)
      Thanks

      Comment


        #4
        Hello JezzaNT,

        Thank you for your response.

        During a disconnect from your data feed there are options you can set on how the NinjaScript Strategy performs.

        Please go to Tools > Options > Strategies > NinjaScript > On Connection Loss... Here you are given four options:
        • Disconnect delay seconds - This will determine how many seconds must pass before a disconnect is considered a disconnect for the Handling options.
        • Number of restart attempts - This will set the number of times NinjaTrader will attempt to restart a strategy on a reestablished connection.
        • Restarts within x minutes - This is amount of time in minutes that the Number of restart attempts will use.
        • Handling - You have three options here; KeepRunning, Recalculate, and StopStrategy.

        The above settings will determine how a Strategy performs during a disconnect. You can find additional information at the following link: http://www.ninjatrader.com/support/h...tegies_tab.htm

        Please let me know if I may be of further assistance.

        Comment


          #5
          Patrick,

          Thanks for that. I did look at that help page and I think it could be clarified with a few examples.

          If the Handling is set to "Keep Running" what happens if:
          1- an entry order is executed
          2- a disconnection occurs
          3- the market price action generates an exit signal (while NT still being disconnected)
          4- NT reconnects

          Upon the reconnection, would the strategy in NT close the position (this does not seem to be what I am seeing)?
          Or do I need "recalculate" for this?

          Comment


            #6
            Hello JezzaNT,

            Thank you for your response.

            Correct, as KeepRunning would continue on once connection was reestablished as if there was no disconnect and would not take into account the information during the disconnect.

            However, Recalculate would take this into account but the recalculation would only occur based on the three factors detailed below:
            • If data feed disconnects for longer than the time specified in "Disconnect delay seconds", the strategy is stopped and the disconnect is logged.
            • If the order feed disconnects and the strategy places an order action while disconnected, the strategy is stopped and the disconnect is logged.
            • If both the data and order feeds disconnect for longer than the time specified in "Disconnect delay seconds", the strategy is stopped and the disconnect is logged.

            Please let me know if I may be of further assistance.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by sightcareclickhere, Today, 01:55 PM
            0 responses
            1 view
            0 likes
            Last Post sightcareclickhere  
            Started by Mindset, 05-06-2023, 09:03 PM
            9 responses
            258 views
            0 likes
            Last Post ender_wiggum  
            Started by Mizzouman1, Today, 07:35 AM
            4 responses
            18 views
            0 likes
            Last Post Mizzouman1  
            Started by philmg, Today, 01:17 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_ChristopherJ  
            Started by cre8able, Today, 01:01 PM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X