Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

What is the relationship between ChangeOrder() and OnOrderUpdate() ?

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

    What is the relationship between ChangeOrder() and OnOrderUpdate() ?

    Hello.

    Does ChangeOrder() always triggers OnOrderUpdate() ?
    Or does it triggers only if something really changed in orders parameters?
    Or it depends of something else?

    I am using a flag variable Is_Change_Submitted that set to TRUE when order changes submitted.
    And I am going to set flag to FALSE in OnOrderUpdate(), but it is not triggered and the flag remains TRUE forever.

    So, what it correct way to handle orders changes?
    Do I need Is_Change_Submitted flag at all?
    Are there any scenarios where it can be useful?
    For example, can I change again or cancel order while it already submitted to change?
    Or what if strategy submit price change and, before order state changed to ChangeSubmitted, strategy will submit quantity change?

    Or I shouldn't care about it in Umnanaged approach?

    Thank you.
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    Hello fx.practic,

    Calling ChangeOrder() will cause OnOrderUpdate() to trigger, even if the values are the same for the working order.

    I would recommend not calling ChangeOrder() if the values are the same, and only call this when you are wanting to change the order price or quantity.

    Below is a link to an unmanaged script that calls ChangeOrder().
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you.
      Will search for bug on my side now.

      Ok. Here is once more question:
      if I am sending CL order with price like 100.248524850896.
      What will be the price of working order? Will it be like original (100.248524850896) or it will be rounded to tick size (100.25)?
      fx.practic
      NinjaTrader Ecosystem Vendor - fx.practic

      Comment


        #4
        Hello fx.practic,

        The order may be ignored or rejected.

        I think the order price must be conformed to a tick size.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          It never was rejected or ignored because of this reason in my practice.
          So, the best approach is to RoundToTIckSize before to send and before to change order.
          Thank you.
          fx.practic
          NinjaTrader Ecosystem Vendor - fx.practic

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          90 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          137 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          68 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          120 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          71 views
          0 likes
          Last Post PaulMohn  
          Working...
          X