Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnOrderUpdate() - concurrency question

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

    OnOrderUpdate() - concurrency question

    I would like to ask:

    Imagine there is a running method OnBarUpdate() ... and in the meantime, some order is updated. Will this parallel change in the order be visible in the running OnBarUpdate() method ?

    That means, at the start of OnBarUpdate() some order can have one state and and before end it can have different state ? Or during one call the order remains stable and unchanged ?

    Are the callbacks like OnBarUpdate() and OnOrderUpdate() called in series one after another, or they can be called in parallel ?

    #2
    Hello misova,

    The OnBarUpdate and OnOrderUpdate methods are asynchronous.

    If OnBarUpdate was processing and OnOrderUpdate triggers and changes the order or position, this will be reflected in OnBarUpdate after the change happens.

    However, it would be impossible to know the order these will run as they are asynchronous.

    (As an example, if you place an order at the top of OnBarUpdate and then check to see if the order is working on the next line or even at the bottom of OnBarUpdate, it will not be working yet and the position will not updated yet. OnOrderUpdate and OnPosition update have not run and have not updated the order or position yet.)
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    637 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    366 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    107 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    569 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    571 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X