Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Nonsense OnOrderUpdate() vs OnExecutionUpdate

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

    Nonsense OnOrderUpdate() vs OnExecutionUpdate

    Hi everyone.

    In the NinjaScript language reference, it is noted on both OnOrderUpdate() and OnExecutionUpdate that

    Notes:
    If you are relying on the OnExecutionUpdate() method to trigger actions such as the submission of a stop loss order when your entry order is filled, ALWAYS reference the properties on the Order object property attached to the Execution object passed into the OnExecutionUpdate() method.
    Why?

    OnOrderUpdate() will be executed first and returning all the information about OrderState under various executed state such as Filled, PartFilled and so forth, including price, quantity, orderId, time, etc.
    So why bother with OnExecutionUpdate() ?

    ​​​​​​​Thank you.

    #2
    Hello Dan_D_Trader,

    Thank you for your post.

    You reference the Order object passed to the OnExecutionUpdate() method as that is the Order object that is updating. You need to know which Order object is executed before you submit protective orders.

    An execution is not the same thing as an order update. Orders can update for various reasons and only in states of Filled or PartFilled would you see an execution. Allowing for access to an Order update and an Execution update separately allows developers greater flexibility.

    There is internal strategy logic that is triggered after OnOrderUpdate() is called but before OnExecutionUpdate() that can adversely affect your strategy if you are relying on tracking fills within OnOrderUpdate().

    Please let me know if you

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    45 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    21 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    31 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X