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

How to sync strategies after internet connection interruption?

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

    How to sync strategies after internet connection interruption?

    Hey,

    My internet went off for 10 minutes, and when it was restarted, in the Strategies tab, I see some of the strategies (that had positions before internet going off) are not in yellow, Sync value is False and I see 0 in Unrealized and Realized P&L.

    How to fix it, so whenever internet restarts, it automatically syncs positions from what was executed previously? I tried clicking "Synchronize All Strategies", but it simply exits current open order, but I do not want that. I want it to 'restore original position'.

    #2
    Hello UltraNIX,

    Thanks for your post.

    What you are asking about is identified as the strategy start behavior. Please see the help guide to review the various choices: https://ninjatrader.com/support/help..._positions.htm

    Immediately Submit automatically submits working orders from when the strategy processed historical data, and assumes the strategy position and account position are where you want it when you enable the strategy. This is typically used to have a strategy resume a position after disabling/enabling. If the strategy already had live orders running, the orders will resume with the new enablement of the strategy if they match the historically calculated orders. If the orders calculated from historical data do not match the live working orders, the live working orders will be canceled and replaced by those calculated from historical data.

    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks. How can I include this "Immediately Submit" into the .cs code of the strategy?

      Comment


        #4
        Hello UltraNIX,

        Thanks for your reply.

        The start behavior is a strategy property found in State.SetDefaults, look for the parameter StartBehavior.

        You can also change this when you apply the strategy as the strategy properties are shown in the User interface.

        Paul H.NinjaTrader Customer Service

        Comment


          #5
          By the way, is there a way to "restore" Realized/Unrealized P&L (In Strategies Tab of main window) after internet connection is restore and Immediately Submit is activated?

          Comment


            #6
            Hello UltraNIX,

            Thanks for your reply.

            When the strategy is restarted it would perform all prior trades now as historical and these would not be reflected in the strategy PNL.

            Paul H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by jpeep, 08-16-2020, 08:31 AM
            13 responses
            487 views
            0 likes
            Last Post notenufftime  
            Started by realblubb, 04-28-2024, 09:28 AM
            2 responses
            32 views
            0 likes
            Last Post realblubb  
            Started by bmarovets, Today, 06:33 PM
            0 responses
            11 views
            0 likes
            Last Post bmarovets  
            Started by ETFVoyageur, Yesterday, 07:05 PM
            4 responses
            38 views
            0 likes
            Last Post ETFVoyageur  
            Started by JGriff5646, Yesterday, 10:02 PM
            2 responses
            24 views
            0 likes
            Last Post JGriff5646  
            Working...
            X