On Tue, Mar 28, 2023 at 10:33 PM, Richard L King wrote:
can you give me a detailed description of the steps you go through to
demonstrate that this workaround doesn¡¯t work, so I can verify or refute
your claim
Yes, I love your spirit! The exact instructions are located . Read and follow them precisely. As I understand your workaround, it is to add the line this.cancelMktData(os.getpid()) right before the line self.disconnect()... that doesn't help. IOW:
--- example.py.~1~ 2023-03-28 19:04:06.322531726 -0400
+++ example.py 2023-03-28 19:07:29.589006097 -0400
@@ -31,6 +31,7 @@
attrib: TickAttrib,
):
print( "Got a price tick, exiting." )
+ this.cancelMktData(os.getpid())
self.disconnect()
def error(self, reqId: TickerId, errorCode: int,
errorString: str, advancedOrderRejectJson = ""):
I've tried this again today with the latest IBGW and the bug still exists and this proposed workaround does not help.
I know you're a Windows person Richard and you're free to use Windows if you want, although I'd prefer you didn't in order to make sure test environments match as closely as possible. However, I have reproduced the problem in a Windows VM as well, but some time ago. You can install python3 for Windows from .
Just please remember, follow the gist exactly. IIRC last time you tried to summarize and port the example to VB or C# or something and I'm guessing in that process may have messed something up. Please be as thoughtful and deliberate as possible. Patches are appreciated.
Make sure to read the entire gist very thoroughly, it is a subtle bug and very easy to misunderstand or see it work once and then, prematurely conclude that you've found a workaround or it's a heisenbug. If you perform the test properly you will see it is clearly a bohrbug.
If the 10.x version of TWS/IBGW fully supported multiple clients (32 no less) you should be able to run the example program over and over and over and over using the pid as the clientID. It's not expected to run the example simultaneously... just sequentially. There doesn't ever need to be more than one client connected. The IB support rep who was assigned to work with me on this has acknowledged their developers know it's a problem but advised I don't hold my breath for a fix.
Lol, I don't actually care that much... my software is printing plenty of money without the functionality. I just thought it was interesting because I stumbled over it while using my tool-set in an ad-hoc fashion (not trading).
It is also important that you test with real-time data using a live account during RTH. The bug can be reproduced intermittently w/ a test account, delayed/frozen data, or outside RTH... but that should not be the final test. The problem only happens with absolute certainty in a "production" environment.
The example code is very short and apparently correct (according to documentation); it was actually written by IB support. And, again, the program should be able to run over and over and over, never hanging on ticks... certainly for something as liquid as VZ.
Because of this, at the end of the day, I agree with Jurgen 100%:
On Mon, Mar 27, 2023 at 05:59 PM, J¨¹rgen Reinold wrote:
have a single client that monitors and executes
It's the only real "workaround"; which is to say there's actually no way to workaround. If someone wants to "run multiple algorithms in parallel" my suggestion would be they look at using ; it's close enough.
Good luck and enjoy!