Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

If an order is rejected, does it need to be canceled?

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

    If an order is rejected, does it need to be canceled?

    Hello,
    I am working on a strategy and need a bit of clarification.
    In a strategy, inside onOrderUpdate(), if the IOrder.OrderState = OrderState .Rejected, does the order need to be canceled? The example code on the Forum does not directly address this condition.

    This came up as an issue, because I am invoking RealtimeErrorHandling.TakeNoAction and must take care of all cases. When an order rejection is detected, I need to exit my position, and cancel all orders. The question I now have is: Do I need to cancel the order that was rejected?

    I would really appreciate a clarification on this.

    Thanks for your help,

    Bormir

    #2
    Hi Bormir, a rejected order is in a terminal state and would normally stop the strategy, so there's no need to cancel it with your setup.

    Comment


      #3
      Hi Bertrand,
      In my original posting, I indicated that I was invoking RealtimeErrorHandling.TakeNoAction, so that the strategy does NOT stop, or terminate. This is the source of my question!

      When I am in the RealtimeErrorHandling.TakeNoAction mode, do I need to cancel an order if it was rejected?

      Does this make sense?

      Thanks for your help,

      Bormir

      Comment


        #4
        No need to cancel the order, rejected is a terminal state, in your case the strategy will continue to run then.

        Comment


          #5
          Thanks!

          Thanks for the clarification Bertrand!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          61 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          149 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          162 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 05-10-2026, 08:12 PM
          0 responses
          99 views
          0 likes
          Last Post CarlTrading  
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          286 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Working...
          X