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 NullPointStrategies, Today, 05:17 AM
    0 responses
    20 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    119 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    63 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    41 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    45 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X