开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Strange Glitch When Requesting PNL


 

This took me forever to diagnose, but here is the glitch.? When request PNL message is sent there is no PNL response if you've already asked before.? Let me explain.

This only happens under certain conditions:
  • PNL is 0.0, no trades have been made
  • TWS only this does not happen with IB gateway
So basically if I start TWS turn on my program it request PNL and receives response just fine.? However, if I turn off my program and restart it, I will never get a PNL response again.? So my code will just freeze waiting for PNL response.? When I restart TWS it resets, so I can request PNL and will receive a response once and not again.

This does not happen with IB gateway, I can request PNL as often as I'd like.? Also this does not happen if my PNL is not zero, so if I've made or lost money it will send my my daily PNL over and over again.

I'm using TWS version 10.15

Join twsapi@groups.io to automatically receive all group messages.