You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe there was a regression from this commit e9b9f77. The original calculation method is correct, so at least there is a reference and testing around this needs to be improved.
This is now fixed from commit 5f6b89f by partially reverting a previous commit which changed the way Portfolio subscribes for position events and updates accounts based on those.
Your provided backtest snippet now runs with the correct ending balance:
Uh oh!
There was an error while loading. Please reload this page.
Confirmation
Before opening a bug report, please confirm:
nautilus_trader
(it may have been fixed already).Expected Behavior
The final account balance should be 1000245 USDT in the example below.
Actual Behavior
The final account balance is 999535 USDT in the example below.
Steps to Reproduce the Problem
Run the code below on commit 9b5cf5d (Mon May 12 15:06:07 2025 +0530) and get the final account balance 999535 USDT.
Run the code below on commit c882a9f (Tue Mar 11 10:34:31 2025 +1100) and get the final account balance 1000245 USDT.
Code Snippets or Logs
Specifications
nautilus_trader
version: develop branchThe text was updated successfully, but these errors were encountered: