Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Please help explain RealtimeErrorHandling.StopCancelClose default actions?

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

    Please help explain RealtimeErrorHandling.StopCancelClose default actions?

    Hello,

    Can you please explain what are the actions taken by NinjaTrader if RealtimeErrorHandling.StopCancelClose is set for RealtimeErrorHandling? Thanks

    Billy

    #2
    Hello billythekid72,

    Thank you for your post.

    StopCancelClose is the default behavior for RealtimeErrorHandling. The 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. For more information about RealtimeErrorHandling behaviors, please see the help guide section here:


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

    Comment


      #3
      Originally posted by NinjaTrader_Emily View Post
      Hello billythekid72,

      Thank you for your post.

      StopCancelClose is the default behavior for RealtimeErrorHandling. The 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. For more information about RealtimeErrorHandling behaviors, please see the help guide section here:
      https://ninjatrader.com/support/help...orhandling.htm

      Please let us know if we may be of further assistance.
      This is not working on my strategy. I've used RealtimeErrorHandling.StopCancelClose and .IgnoreAllErrors but any of them do anything. StopCancelClose doesn't close any position neither stop the strategy and IgnoreAllErrors is not taking care about error handling. I use this code from other NT support staf I found on the forum:

      protected override void OnOrderUpdate(Order order, double limitPrice, double stopPrice,
      int quantity, int filled, double averageFillPrice,
      OrderState orderState, DateTime time, ErrorCode error, string comment)
      {
      if (order.Name == "MyStopLong")
      {

      if (error == ErrorCode.OrderRejected)
      {
      Print("Order rejected, submitting hard exit.");
      ExitLong();
      }

      }

      Comment


        #4
        Hello cgvmlg,

        Thank you for your note.

        What is the behavior you experience when you use that snippet in your script with the different RealTimeErrorHandling options? Do you have an order in your strategy with the name MyStopLong? What are you looking to achieve with your strategy? Please provide as many details as possible so I may better understand your inquiry and assist you accordingly.

        I look forward to your reply.

        Comment


          #5
          Originally posted by NinjaTrader_Emily View Post
          Hello cgvmlg,

          Thank you for your note.

          What is the behavior you experience when you use that snippet in your script with the different RealTimeErrorHandling options? Do you have an order in your strategy with the name MyStopLong? What are you looking to achieve with your strategy? Please provide as many details as possible so I may better understand your inquiry and assist you accordingly.

          I look forward to your reply.
          My mistake. Is working now.
          Thanks

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          50 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          126 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          69 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          42 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          46 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X