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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 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
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X