I'm working on a custom base Strategy class that will log the PnL of each trade once the trade exits. This seems to be working fine now, and I'm handling this logging logic (writing to a CSV file) in OnPositionUpdate once each trade exits.
However, when I manually exit a trade using chart trader's "Close" button or from the accounts control panel right clicking the account and selecting "Close all selected account positions", nothing gets logged and it seems like OnPositionUpdate doesn't fire in those cases.
Is this by design? How would I get the latest position update, and subsequent PnL of a closed trade, regardless of it the exit was manual or automated?
Thanks as always,
- Jay

Comment