Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Memeber function call synchronization issues

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

    Memeber function call synchronization issues

    Hello

    I use Unmanaged = true option.


    I noticed that during back testing OnBarUpdate is executed before the previous call OnExecution (or OnOrderUpdate) is processed. In other words, Position.MarketPosition and Position.Quantity did not get updated from the execution from the previous bar.

    Is there a way to synchronize it automatically, and if not where should I insert a flag to prevent this?

    Best regards,
    Sergey.

    #2
    Hi Sergey, if you used Unmanaged or Managed mode would be no deciding factor here, but thanks for mentioning.

    The position update would only be guaranteed in the next OnBarUpdate() as then OnPositionUpdate() internally had been called. You would generally see this sequence - OnOrderUpdate->OnExecution->OnPosition

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    64 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    35 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    59 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    51 views
    0 likes
    Last Post CarlTrading  
    Working...
    X