• 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

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
    Patrick H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Fness2020, Yesterday, 08:29 PM
    1 response
    26 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by Hurrikane, Yesterday, 09:18 PM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by stewarco, Today, 05:46 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Jermaine  
    Started by andrewtrades, Yesterday, 08:24 PM
    2 responses
    15 views
    0 likes
    Last Post NinjaTrader_ChristopherD  
    Started by authenticx, Yesterday, 10:07 PM
    1 response
    34 views
    0 likes
    Last Post NinjaTrader_PatrickG  
    Working...
    X