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 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
    20 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    22 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X