erdewit / ib_insync

Python sync/async framework for Interactive Brokers API
BSD 2-Clause "Simplified" License
2.81k stars 755 forks source link

PNL Issue #618

Closed EngAhmedElkady closed 1 year ago

EngAhmedElkady commented 1 year ago

when try to return pnl , give me this Daily PnL: [PnL(account='my account number', modelCode='', dailyPnL=nan, unrealizedPnL=nan, realizedPnL=nan)]

why the dailyPnl is nan, this is code pnl = self.ib.pnl()

erdewit commented 1 year ago

Call this method first:

https://ib-insync.readthedocs.io/api.html#ib_insync.ib.IB.reqPnL