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 CarlTrading, 03-31-2026, 09:41 PM
          1 response
          67 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          36 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          59 views
          1 like
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          62 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          53 views
          0 likes
          Last Post CarlTrading  
          Working...
          X