Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    BertrandNinjaTrader Customer Service

    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.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Thanks!

          Thanks for the clarification Bertrand!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Austiner87, Today, 03:42 PM
          1 response
          17 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by cshox, Today, 11:11 AM
          2 responses
          15 views
          0 likes
          Last Post cshox
          by cshox
           
          Started by algospoke, Today, 06:53 PM
          0 responses
          10 views
          0 likes
          Last Post algospoke  
          Started by mlprice12, 12-21-2021, 04:55 PM
          3 responses
          298 views
          0 likes
          Last Post paypachaysa  
          Started by lorem, 04-25-2024, 09:18 AM
          20 responses
          87 views
          0 likes
          Last Post lorem
          by lorem
           
          Working...
          X