• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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().
    https://ninjatrader.com/support/foru...269#post802269
    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 KNalley, Today, 09:33 AM
          0 responses
          4 views
          0 likes
          Last Post KNalley
          by KNalley
           
          Started by AMATX, Today, 09:29 AM
          0 responses
          2 views
          0 likes
          Last Post AMATX
          by AMATX
           
          Started by arnegockeln, Today, 09:25 AM
          0 responses
          1 view
          0 likes
          Last Post arnegockeln  
          Started by herkok, Today, 09:15 AM
          0 responses
          8 views
          0 likes
          Last Post herkok
          by herkok
           
          Started by itrader46, Today, 07:51 AM
          2 responses
          20 views
          0 likes
          Last Post NinjaTrader_ChrisL  
          Working...
          X