Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Disabled

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

    Strategy Disabled

    I see at times when there is an error on a running strategy it shuts itself down. And I am left with a double position. Is there a way in Ninja Trader to not let that happen? Like if there is an error and an order did go through maybe the strategy can just flatten the positions opened too before or just after disabling itself?

    And to restart you have to open the Strategies Box. Is there a way to right click and then go to Strategies and enable it that way too? Maybe a suggestion.

    Thank you.

    #2
    Hello Trader17,

    By default, NinjaTrader 8.0.21.1 will submit orders to exit any position opened by the strategy when disabled due to an error with the RealtimeErrorHandling.StopCancelClose option.


    You can submit orders to flatten the account in OnStateChange when State is State.Terminated.


    You can choose to keep a strategy running with RealtimeErrorHandling.IgnoreAllErrors.

    Strategies can be enabled by checking the Enabled checkbox in the strategy parameters when opening the Strategies window from a chart.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks. I am still on version 19.1 so need an update. So then maybe in the future a suggestion to re-enable the strategy by right clicking on the chart instead of opening the box and enabling from the box? Or maybe another quicker way? Where do you set the IgnoreAllErrors? In the script or there is a box to check in the Strategies Window?
      Thanks a lot.

      Comment


        #4
        Hello Trader17,

        The quickest way to enable or disable is to check the Enabled checkbox on the Strategies tab of the Control Center.

        RealtimeErrorHandling is set in the code in OnStateChange when State is SetDefaults or Configure.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_ChelseaB View Post
          Hello Trader17,

          By default, NinjaTrader 8.0.21.1 will submit orders to exit any position opened by the strategy when disabled due to an error with the RealtimeErrorHandling.StopCancelClose option.


          .
          Thanks. I downloaded version 8.0.21.1 just now. So when you say in that version by default it will submit orders to exit any position opened by the strategy just before being disabled, is this a setting I am supposed to set somewhere? I want to make sure if the last operation was an error for some reason the strategy corrects itself and then goes on to take the next setup.

          Thanks.

          Comment


            #6
            Hello Trader17,

            The close strategy position action is part of the RealtimeErrorHandling.StopCancelClose which is used by default.
            "Defines the behavior of a strategy when a strategy generated order is returned from the broker's server in a "Rejected" state. Default behavior is to stop the strategy, cancel any remaining working orders, and then close any open positions managed by the strategy by submitting one "Close" order for each unique position."
            https://ninjatrader.com/support/help...orhandling.htm

            If this is being changed, set it in State.Configure to ensure this is the setting on the current instance.

            Let me know if you find any issues with the strategy closing its opened positions.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Thank you. I will keep an eye on it. Because sometimes the strategy disables itself but I am left with an open position usually twice of the contracts traded. I think I might need to name them individually too.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              95 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              50 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              31 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              35 views
              0 likes
              Last Post TheRealMorford  
              Started by Mindset, 02-28-2026, 06:16 AM
              0 responses
              72 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X