Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

connection loss handling

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

    connection loss handling

    Hi,

    I read the section in the manual ( http://www.ninjatrader.com/support/h...layseconds.htm ) about the handling options when a connection loss occured, but I still need some clarification:

    Scenario: Trading live through IB with the data coming from Kinetick; data connection is lost and later reestablished.

    a) Option "Keep running":
    - If the data connection is reestablished will the strategy load all the missing data?
    - Will it send orders while going through the data (one bar or tick at a time as set in COBC)?
    - Or will it send orders only AFTER having finished going through the reloaded data (this means: will all order changes be sent to the broker in sequence or only the last version)?

    b) Option "Recalculate":
    It says in the manual
    Recalculate: Strategies will attempt to recalculate its strategy position when a connection is reestablished and held for longer than RestartDelaySeconds (default = 10). Recalculations will only occur if the strategy was stopped based on the conditions below. Should the connection be reestablished before the strategy was stopped, the strategy will continue running without recalculating as if no disconnect occurred.
    If data feed disconnects for longer than the time specified in DisconnectDelaySeconds, the strategy is stopped and a disconnect email alert will be sent.
    If the order feed disconnects and the strategy places an order action while disconnected, the strategy is stopped and a disconnect email alert will be sent.
    If both the data and order feeds disconnect for longer than the time specified in DisconnectDelaySeconds, the strategy is stopped and a disconnect email alert will be sent.
    - Is my understanding correct that the strategy will be stopped after the set time, but then be restarted? So if I look at the strategy in the Control Center it will be OFF (unchecked) but later turn itself ON again (checked)?
    - Or will the strategy remain OFF, but in the tab "Positions" a recalculated line will show?
    - So what exactly does "recalculate" refer to?

    Thanks for making that clear to me!
    NutFlush

    #2
    Hello NutFlush,

    Thank you for your post.
    • NinjaTrader will reload the data after the re-connect. This is based on the guidelines set in the Help Guide at the following link under 'When does NinjaTrader load historical data?": http://www.ninjatrader.com/support/h...rical_data.htm
    • From my testing there is no re-calculation done on the historical data and any orders that would have been generated would not be as the strategy does not re-calculate on the data loaded in.
    • The strategy will not be restarted after the disconnect, if a disconnect is logged the strategy is stopped. Recalculate means if a re-connect is established during the 'Restart within X minutes' duration (Tools > Options > Strategies > NinjaScript) that the strategy will re-calculate it's position based of the historical data that is reloaded.

    Please let me know if you have any questions.

    Comment


      #3
      Originally posted by NinjaTrader_PatrickH View Post
      Hello NutFlush,

      Thank you for your post.
      • NinjaTrader will reload the data after the re-connect. This is based on the guidelines set in the Help Guide at the following link under 'When does NinjaTrader load historical data?": http://www.ninjatrader.com/support/h...rical_data.htm
      • From my testing there is no re-calculation done on the historical data and any orders that would have been generated would not be as the strategy does not re-calculate on the data loaded in.
      • The strategy will not be restarted after the disconnect, if a disconnect is logged the strategy is stopped. Recalculate means if a re-connect is established during the 'Restart within X minutes' duration (Tools > Options > Strategies > NinjaScript) that the strategy will re-calculate it's position based of the historical data that is reloaded.

      Please let me know if you have any questions.
      Hi Patrick,

      thanks for your reply!

      Option a) "Keep Running" is clear for me now. The only thing I'd still like to ask is what happens when the data feed is up, but the trading connection is lost and an order is sent during that time.
      - What kind of state will the IOrder object be in?
      - Will the order be sent again once the trading connection is up again?

      Regarding option b) "Recalculate" I still don't understand what the purpose of it is. As you said the strategy will remain switched OFF. But as it says here the recalculation is done ONLY after the strategy was in fact turned OFF.
      Recalculate: ... Recalculations will only occur if the strategy was stopped based on the conditions below. Should the connection be reestablished before the strategy was stopped, the strategy will continue running without recalculating as if no disconnect occurred.
      - So what exactly is recalculated?
      - Where is the result of that recalculation shown?
      - How could that be useful for the trader?

      Thanks for making that more clear to me!
      NutFlush

      Comment


        #4
        Hello NutFlush,

        Thank you for your response.
        Originally posted by NutFlush View Post
        The only thing I'd still like to ask is what happens when the data feed is up, but the trading connection is lost and an order is sent during that time.
        - What kind of state will the IOrder object be in?
        - Will the order be sent again once the trading connection is up again?
        If the connection status is not fully connected no orders will be submitted.
        Originally posted by NutFlush View Post
        Regarding option b) "Recalculate" I still don't understand what the purpose of it is. As you said the strategy will remain switched OFF. But as it says here the recalculation is done ONLY after the strategy was in fact turned OFF.- So what exactly is recalculated?
        - Where is the result of that recalculation shown?
        - How could that be useful for the trader?
        If the order feed disconnects and the strategy places an order action while disconnected, the strategy is stopped and the disconnect is logged.
        This is useful when a reconnect is made successfully, as the strategy will recalculate the position and submit orders to achieve that position based on the historical data that is loaded after reconnect.
        I recommend reviewing the information at the following link on these options: http://www.ninjatrader.com/support/h...tegies_tab.htm

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

        Comment


          #5
          This is useful when a reconnect is made successfully, as the strategy will recalculate the position and submit orders to achieve that position based on the historical data that is loaded after reconnect.
          I recommend reviewing the information at the following link on these options:
          So the "recalculation" means, that the strategy just submits the same orders, that were ommited due to failed order connection ?

          Possible problem is:
          In case when strategy sends some limit order. Connection dropped and this order could not be sent.
          Now, connection was reestablised,and herethe same limit order at the same price will be submitted again ?
          Problem is, that that limit entry order could be filled in the period of connection failure, but now, when it was resubmitted later, there is a posibility, that is will not be filled again, or maybe profit was hit already.

          Do I understand it correctly ?

          Comment


            #6
            Hello misova,

            Thank you for your response.

            Your understanding here is correct. Orders technically could not be sent during a disconnect and if the strategy cannot calculate, as the price feed has stopped due to the disconnect, there would be no method for the strategy to calculate that an order needed to be sent.

            Recalculate allows the strategy to recalculate it's position once a connection is re-established. This means the strategy calculates based on the conditions within it's own code and then determines if the position should be changed, if so it will submit orders to correct the position. Upon the re-connect and recalculation, if the strategy determines an order would have been sent it will send that order based on the conditions within the strategy.

            Please let me know if you have any questions.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            649 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            370 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            109 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            574 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            576 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X