-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Report
Confirmation
Before opening a bug report, please confirm:
- [v ] I’ve re-read the relevant sections of the documentation.
- [v ] I’ve searched existing issues and discussions to avoid duplicates.
- [v ] I’ve reviewed or skimmed the source code (or examples) to confirm the behavior is not by design.
- [v ] I’ve tested this issue using a recent development wheel (
devdevelop oranightly) and can still reproduce it.
Expected Behavior
When positions have been closed in the client but remain open in the cache (due to DB persistence), the expected behavior is for NT to identify this and remove the phantom positions
Actual Behavior
In practice, this case is not recognized by NT, and the phantom positions remain open in the cache/DB, causing downstream mayhem
Steps to Reproduce the Problem
The set up is a bit complex, and I have only thought it out for NETTING accounts:
- the setup is a cache that is persisted to DB, and a pattern of running NT that includes node shutdowns and then restarts (which makes sense when running strategies for days and weeks)
- run NT and have your strategy open a position
- make sure that the DB is reflecting this open position
- 'offline' (w/o NT running) close the position through direct interaction with the client
This is where the expected behavior comes in:
run NT again - NT is expected to recognize that the DB and the client are not aligned, and update the DB by closing the positions
Code Snippets or Logs
Specifications
- OS platform: Ubuntu
- Python version: 3.12.7
nautilus_traderversion: 1.221.0a20251002
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Done