- ago
I run an identical (apart from position size, but this isn't a capital constraint issue) pairs trading script on two VMs on two IB accounts using IB Gateway 10.28. On one VM, the data sets update automatically with no issue and the trade logic works perfectly in real time. On the other, the data auto update fails and a manual update also fails with:

24/07/2024 08:32:52:553
Interactive Brokers
Request for: ABCB, 3 D, 30 mins data Timed Out
24/07/2024 08:32:53:482
InteractiveBrokers
162: Historical Market Data Service error message:API historical data query cancelled: 2157142 (I haven't cancelled the update, this appears to be automated)

This instance is also missing valid entry/exit signals. e.g. last night it missed one valid exit and four valid entries that the other VM executed with no issue. I double check multiple times a day that Gateway is still connected to this WL instance (it is) and I have also checked that the Strategy/Order monitors have identical settings to the other VM where everything is working (they do).

Both VMs are on the same LAN and I've run multiple network tests on both - no issues.

The only obvious difference (and one that I have been nagging IB to change for at least a month) is that the working VM connects to the EU IB server farm, while the failing one connects to the US farm. Hopefully I can get that changed this week.

Apart from that, I'm completely at a loss. Is there anything else I should be checking? Many thanks
0
212
Solved
8 Replies

Reply

Bookmark

Sort
Cone8
 ( 3.70% )
- ago
#1
Re: 162: Historical Market Data Service error message:API historical data query cancelled:
These are error messages from IB. You need to work on getting a proper connection.
Something isn't configured correctly. Are you trying to connect to the same account from 2 different machines?

To change the region, just hit "More Options" on the IB TWS/Gateway login dialog.
0
- ago
#2
Thx but no, it's separate accounts.
That region setting is set the same on both but it doesn't actually change the server location (even after checking that region setting is identical, the Gateway interfaces show "usfarm.nj" on one VM and "eufarm" on the other).

I've hassled IB again to get this sorted, but the earliest they will change it (if they actually do it this time) will be next weekend.

0
Cone8
 ( 3.70% )
- ago
#3
If it's connecting, then they only thing it could be is the setup. I remember you missed a setting (operator time zone) in the setup for your first connection that we worked out on a zoom call. Go through the IB API setup - step by step. Maybe it's that time zone setting again.
0
- ago
#4
Thanks but "Send instrument-specific attributes for dual-mode API client in.." is correcctly set to "operator timezone." on both VMS as per the WL instructions at https://www.wealth-lab.com/extension/detail/InteractiveBrokers
0
- ago
#5
I've restarted IB Gateway and WL and the historical updates are working again.

On restart, I found this in the log:
"24/07/2024 11:48:43:492
WL8
Exception Reading DataSet file: There is an error in XML document (1, 1).
InvalidOperationException
There is an error in XML document (1, 1). Inner Exception: Data at the root level is invalid. Line 1, position 1.
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at System.Xml.Serialization.XmlSerializer.Deserialize(TextReader textReader)
at WealthLab.Core.DataSet.ParseXML(String xml)
at WealthLab.Core.DataSetFactory.Initialize()"

Not sure if it's relevant but thought I'd better post just in case. Thx
0
Cone8
 ( 3.70% )
- ago
#6
That XML doc error is from WealthLab, not from the IB Provider.
0
- ago
#7
OK thx - just wondered if the error was of any significance
0
- ago
#8
Rebooting Windows seems to have resolved the issue, which after all the network tests showed no issues is rather odd, but...

Thx for the various suggestions
0
Best Answer

Reply

Bookmark

Sort