Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

can i get all order not exit?

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

    can i get all order not exit?

    i use strategies to control the order take profit or loss. but sometime network error, ninjatrader turn to orange. I setup the network and ninjatrader reconnect success
    but strategies will lost all value like order, profit or loss target.
    can any method to get all order, and exit all order after network error and reconnect?

    log here:
    2022-09-28 05:49:12:402|3|4|Strategy '/251559192' lost price connection for more than 10 seconds and will be restarted.
    2022-09-28 05:49:12:402|1|4|Disabling NinjaScript strategy '/251559192'​​

    #2
    Hello moneyexe,

    Thank you for your post.

    NinjaTrader has different options available to handle connection loss while running a NinjaScript strategy. These options may be found by going to Control Center > Tools > Options > Strategies and are described on the help guide page here:


    The three options are Keep Running, Recalculate, and Stop Strategy. If you prefer to keep the strategy up and running so that it will resume when the connection is reestablished, you could use the option Keep Running.

    Please let us know if we may be of further assistance.

    Comment


      #3
      Originally posted by NinjaTrader_Emily View Post
      Hello moneyexe,

      Thank you for your post.

      NinjaTrader has different options available to handle connection loss while running a NinjaScript strategy. These options may be found by going to Control Center > Tools > Options > Strategies and are described on the help guide page here:
      https://ninjatrader.com/support/help...riptProperties

      The three options are Keep Running, Recalculate, and Stop Strategy. If you prefer to keep the strategy up and running so that it will resume when the connection is reestablished, you could use the option Keep Running.

      Please let us know if we may be of further assistance.
      i try enable the 'Cancel entry orders when a strategy is disabled' and 'Cancel exit orders when a strategy is disabled'
      and set handling 'Recalculate'
      but the order who is filled not exit after reconnect success.
      is any other setting i need to set?

      1. strategies is running
      Click image for larger version  Name:	螢幕擷取畫面 2022-09-28 135737.png Views:	0 Size:	18.7 KB ID:	1217317

      2. network error​
      Click image for larger version  Name:	螢幕擷取畫面 2022-09-28 135836.png Views:	0 Size:	23.6 KB ID:	1217318
      2. reconnect but order not exit
      Click image for larger version  Name:	螢幕擷取畫面 2022-09-28 135900.png Views:	0 Size:	24.2 KB ID:	1217319

      setting
      Click image for larger version

Name:	螢幕擷取畫面 2022-09-28 140322.png
Views:	275
Size:	24.7 KB
ID:	1217320
      Last edited by moneyexe; 09-28-2022, 12:04 PM.

      Comment


        #4
        Hello moneyexe,

        Thank you for your reply.

        With the Recalculate option, the recalculation will only occur if the strategy is fully stopped. If the connection is re-established before the strategy is stopped, the strategy will continue as if there was no disconnection and will not recalculate any positions.

        What behavior are you expecting to see compared to what you are experiencing? You mentioned the position did not exit after successfully reconnecting; were you expecting it to exit the position? It is important to keep in mind that in the case of any questions about live orders, please always reach out to your broker's Orders Desk immediately to confirm and manage your live orders and positions.

        I look forward to your reply.

        Comment


          #5
          Originally posted by NinjaTrader_Emily View Post
          Hello moneyexe,

          Thank you for your reply.

          With the Recalculate option, the recalculation will only occur if the strategy is fully stopped. If the connection is re-established before the strategy is stopped, the strategy will continue as if there was no disconnection and will not recalculate any positions.

          What behavior are you expecting to see compared to what you are experiencing? You mentioned the position did not exit after successfully reconnecting; were you expecting it to exit the position? It is important to keep in mind that in the case of any questions about live orders, please always reach out to your broker's Orders Desk immediately to confirm and manage your live orders and positions.

          I look forward to your reply.
          yes,'keep running' is what i want
          but i also want to ask if i want the position exit after successfully reconnecting. can 'Cancel entry orders when a strategy is disabled' and 'Cancel exit orders when a strategy is disabled'​ do this action?

          thank's your reply.​

          Comment


            #6
            Hello moneyexe,

            Thank you for clarifying.

            The options to cancel entry/exit orders when a strategy is disabled aren't quite related to disconnections. Those cancels would occur if you went to the Strategy tab of the Control Center and disabled an active strategy by unchecking the "Enabled" box of by disabling the strategy from a chart. If a strategy is stopped due to a disconnection, because it is not connected to your broker/data provider there is no way to cancel those working orders.

            That being said, you could use the OnConnectionStatusUpdate() method to add logic based on the connection status of your strategy. For more information:


            Additionally, there is an option in the right-click menu of the Strategies tab to "Synchronize all strategies" that would sync the account position with the strategy position. I am not sure if this is something that you're interested in, although it may be an option worth exploring once NinjaTrader is reconnected and you would like to sync your positions. For more information regarding the options in the Strategies tab:


            For more information about syncing account positions:


            Please let us know if we may be of further assistance.

            Comment


              #7
              Originally posted by NinjaTrader_Emily View Post
              Hello moneyexe,

              Thank you for clarifying.

              The options to cancel entry/exit orders when a strategy is disabled aren't quite related to disconnections. Those cancels would occur if you went to the Strategy tab of the Control Center and disabled an active strategy by unchecking the "Enabled" box of by disabling the strategy from a chart. If a strategy is stopped due to a disconnection, because it is not connected to your broker/data provider there is no way to cancel those working orders.

              That being said, you could use the OnConnectionStatusUpdate() method to add logic based on the connection status of your strategy. For more information:


              Additionally, there is an option in the right-click menu of the Strategies tab to "Synchronize all strategies" that would sync the account position with the strategy position. I am not sure if this is something that you're interested in, although it may be an option worth exploring once NinjaTrader is reconnected and you would like to sync your positions. For more information regarding the options in the Strategies tab:


              For more information about syncing account positions:


              Please let us know if we may be of further assistance.
              hi i have one more question.
              in saturday ninjatrader will auto logout and discount, after that the strategy will disabled. is any method set the strategy will continue run to wait to monday

              Comment


                #8
                Hello moneyexe,

                Thank you for your reply.

                One option that you could test out would be to put enough seconds in the Disconnect delay seconds setting in the Control Center > Tools > Options > Strategies > On Connection Loss settings. You could then use Keep Running in the case that you don't want the strategy to calculate historical data when it connects again or you could use Recalculate to run historical data and calculate the strategy positions when it connects again. After the Disconnect delay seconds have passed, NinjaTrader will try to restart the strategy. You could set the Number of restart attempts to allow for several attempts to make sure there are enough chances to restart and Restarts within x minutes should be something like 10 minutes, just for good measure. This should allow plenty of leeway for the strategy to operate once you are able to reconnect the platform on Monday.

                Please let us know if we may be of further assistance.​

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by NullPointStrategies, Yesterday, 05:17 AM
                0 responses
                62 views
                0 likes
                Last Post NullPointStrategies  
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                134 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                75 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                45 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                50 views
                0 likes
                Last Post TheRealMorford  
                Working...
                X