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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    46 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    22 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    14 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    21 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    23 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X