Open tmills86 opened 6 months ago
I think this might be a bug in IB: we just log the packet: https://github.com/QuantConnect/Lean.Brokerages.InteractiveBrokers/blob/dd264cf3470942151649005e921c129c68747a34/QuantConnect.InteractiveBrokersBrokerage/InteractiveBrokersBrokerage.cs#L2456C59-L2457C10
Log.Trace($"InteractiveBrokersBrokerage.HandlePortfolioUpdates(): {e}");
Expected Behavior
Lean logs should be showing UnrealisedPnl and RealisedPnl in their respective columns.
Actual Behavior
The logs have these two swapped. An example of the output I'm getting on my server looks like this:
As you can see, my position is 0, but I'm getting an UnrealisedPnl of 87.06, when this should be in the RealisedPnl column.
Reproducing the Problem
Take any position on interactive brokers and then close it. The UnrealisedPnl and RealisedPnl columns will be swapped.
System Information
Ubuntu 22.04.4 LTS
Checklist
master
branch