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.
    Emily C.NinjaTrader Customer Service

    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.
        Emily C.NinjaTrader Customer Service

        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 Pabulon, Today, 03:08 AM
          0 responses
          3 views
          0 likes
          Last Post Pabulon
          by Pabulon
           
          Started by sukhob, 05-18-2023, 08:26 PM
          2 responses
          127 views
          0 likes
          Last Post TraderJA  
          Started by timwey, Yesterday, 10:55 AM
          4 responses
          23 views
          0 likes
          Last Post timwey
          by timwey
           
          Started by DJ888, 06-28-2024, 10:18 PM
          3 responses
          39 views
          0 likes
          Last Post AdamDJ8
          by AdamDJ8
           
          Started by ntwong, Yesterday, 08:22 PM
          0 responses
          16 views
          0 likes
          Last Post ntwong
          by ntwong
           
          Working...
          X