Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Position Status after connection failure

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

    Position Status after connection failure

    I'm concerned that in an automated strategy an order could fill during an outage and my strategy would not be aware of the change.

    So I have two questions:

    1) How can I determine my position status after a connection failure?

    2) Assuming that an opening or closing order has filled during a connection failure, how can I determine the parameters of the order (i.e. the number of contracts and the average fill price at least, and ideally the time of the fill) after the connection is restored?

    Thanks for your assistance.

    #2
    Hello cmt_Robert,

    Thank you for your post.

    1. During a disconnect this is not possible. However, you can use OnConnectionStatus() for the different connection statuses, but durign the disconnect there is no way to get the account info: http://www.ninjatrader.com/support/h...tionstatus.htm

    2. Upon re-connect the order will be updated via the API. You will need to use the settings detailed in the following link to determine how the strategy reacts to the disconnect and re-connect: http://www.ninjatrader.com/support/h...tegies_tab.htm

    Comment


      #3
      Thank you Patrick.

      I apologize for not being more clear. I understand that DURING the outage there is nothing that can be done to determine the position. I was intending to ask about what can be done after recovery from an outage to re-orient my strategy while keeping it running.

      Looking at the link you provided, I see that I can select "Recalculate" as a Handling Option on disconnect. The notes on this refer to a strategy having been "stopped". I'd like to clarify if "stopped" is the same as "terminated", as I don't want my strategy to be terminated just because of a transient outage. At the same time, I don't want to have my strategy become confused about its state because of a transient outage either. If the strategy is being "stopped" during the outage and then is automatically "restarted" once the connection has recovered that would be ideal.

      Please advise.

      Comment


        #4
        Hello cmt_Robert,

        Thank you for your response.

        Stopped means the strategy is disabled and Recalculate will not occur. So you will want to work with the Disconnect Delay Seconds to set the time before the strategy disables.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by jpeep, 08-16-2020, 08:31 AM
        17 responses
        502 views
        0 likes
        Last Post notenufftime  
        Started by ETFVoyageur, 05-07-2024, 07:05 PM
        15 responses
        124 views
        0 likes
        Last Post ETFVoyageur  
        Started by esmall, Today, 07:14 PM
        0 responses
        9 views
        0 likes
        Last Post esmall
        by esmall
         
        Started by Option Whisperer, 05-09-2024, 07:58 PM
        6 responses
        26 views
        0 likes
        Last Post Option Whisperer  
        Started by rayyyu12, Today, 05:38 PM
        0 responses
        12 views
        0 likes
        Last Post rayyyu12  
        Working...
        X