Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Variable Assignments

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

    Variable Assignments

    When using the unmanaged approach, should I assign orders in OnBarUpdate or OnOrderUpdate? And when that order is filled, should I assign the executed order in OnExecutionUpdate? The help guide gives an example of assigning variables in OnBarUpdate, but then says to assign in OnOrderUpdate for more accurate assignments.

    Any help is appreciated.
    Last edited by Lumbeezl; 01-24-2019, 06:03 PM. Reason: Added tags

    #2
    Hello Lumbeezl,

    In general, this would be up to your design but it is commonly suggested to use the OnOrderUpdate or OnExecutionUpdate for multiple reasons, often to assign variables as this would be more accurate toward the actual order events. These overrides are event-driven based on the events of the orders so you can use that information to further drive logic. This is more accurate in the sense that you are not waiting on a bar close or for data to come in to drive the script.

    If you only need to know when the order is filled to assign the variable, you could just use OnExecution however if you needed to track the order earlier on OnOrderUpdate would be best. Using the order events would generally be suggested for situations where you may need to track partial fills or also do other actions based on the order events rather than waiting for bar closes, however, this is again dependant on your overall goal.

    I look forward to being of further assistance.

    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    11 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    10 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    11 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,981 views
    3 likes
    Last Post jhudas88  
    Started by rbeckmann05, Yesterday, 06:48 PM
    0 responses
    9 views
    0 likes
    Last Post rbeckmann05  
    Working...
    X