Replies: 3 comments 10 replies
-
|
Need to call |
Beta Was this translation helpful? Give feedback.
-
|
Hi @gnzsnz , I'm running this code inside a Jupyter notebook, and I noticed that positions and NetLiquidation values only update after I interrupt the while loop and run the cell again. They do not update while the loop is running. I suspect this may be related to how the event loop or callbacks work in ib_async. Do you know what might be causing this?
|
Beta Was this translation helpful? Give feedback.
-
|
Replacing all the time.sleep with IB.sleep fixes the problem. In short, even if you are using sync interfaces, you should leave room for event loops by running IB.sleep periodically. |
Beta Was this translation helpful? Give feedback.



Uh oh!
There was an error while loading. Please reload this page.
-
I have this function
And I found that it doesn't get updated until we reconnect, for example, in the first screenshot, I opened a connection, and then keep calling get_positions every 30 seconds, and in the middle of the loop, I sold the
EOSEwith my phone, but it doesn't get refreshedMeanwhile, if I start another connection with clientId=2 after selling EOSE, and run

get_positionsat the same time, it shows the correct positions.Appreciate any help!
Beta Was this translation helpful? Give feedback.
All reactions