• 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

ChangeOrder rejects

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

    ChangeOrder rejects

    Hello,

    I get broker rejects error messages when using ChangeOrder(). I my opinion the problem is caused because I am not getting the Filled OrderState before sending ChangeOrder().

    To avoid it I use OnExecutionUpdate() because this is supposed to be updated more often that OnOrderUpdate() and I set these conditions before using ChangeOrder():

    if (MyOrder.OrderState != OrderState.Filled
    && MyOrder.OrderState != OrderState.Cancelled
    && MyOrder.OrderState != OrderState.CancelPending
    && MyOrder.OrderState != OrderState.Unknown
    && MyOrder.OrderState != OrderState.ChangePending
    && MyOrder.OrderState != OrderState.Rejected )

    May I apply any other filter to avoid rejections?

    #2
    Hello guillembm,

    Thank you for your post.

    Those checks should cover invalid attempts to cancel.

    Please let me know if you have any questions.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      I believe that the state is not updated as often or as fast as needed. Any idea on how to prevent executing the ChangeOrder() method before OnExecutionUpdate?

      Comment


        #4
        Hello guillembm,

        Thank you for your response.

        Order States should be checked in OnOrderUpdate(): https://ninjatrader.com/support/help...rderupdate.htm

        OnExecutionUpdate() will not update more than OnOrderUpdate(). OnExecutionUpdate() will be called after OnOrderUpdate().

        Please let me know if you have any questions.
        Patrick H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ArmKnuckle, Today, 01:59 AM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by seppyr, Today, 01:53 AM
        1 response
        17 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by matthewbartlett, Today, 01:22 AM
        1 response
        8 views
        0 likes
        Last Post Emma1
        by Emma1
         
        Started by ct_fx, Today, 05:14 AM
        0 responses
        12 views
        0 likes
        Last Post ct_fx
        by ct_fx
         
        Started by Beauregard, Today, 04:36 AM
        0 responses
        9 views
        0 likes
        Last Post Beauregard  
        Working...
        X