Lean.Brokerages.InteractiveBrokers
Lean.Brokerages.InteractiveBrokers copied to clipboard
Improve Data Connection Logic
Expected Behavior
If the data connection is lost, LEAN recovers it. No need to restart the deployment.
Actual Behavior
Apparently the algorithm trading SPX options fails because the algorithm stops receiving SPX (index data), so it didn't trigger the option universe filter. The latest "Market data farm connection" says
2023-08-08T05:07:28.4818118Z TRACE:: InteractiveBrokersBrokerage.HandleError(): RequestId: -1 ErrorCode: 2108 - Market data farm connection is inactive but should be available upon demand.usopt
but it refers to usopt, not index. When the user restarted the algorithm, it received the data.
Potential Solution
N/A
Checklist
- [x] I have completely filled out this template
- [x] I have confirmed that this issue exists on the current
masterbranch - [x] I have confirmed that this is not a duplicate issue by searching issues
- [x] I have provided detailed steps to reproduce the issue
We had a second report today (Jul 22nd, 2024).
LEAN should not trigger soft restart
2024-08-11T23:51:08.7178800Z TRACE:: InteractiveBrokersBrokerage.StartGatewayRestartTask(): triggering soft restart
for data connection if there are no subscriptions:
2024-08-11T22:11:27.0548386Z TRACE:: CompositeDataQueueHandler.SetJob(): will use ["QuantConnect.DataDistribution.Common.LocalDataDistributionConsumer"]
...
2024-08-11T23:50:56.5941827Z TRACE:: InteractiveBrokersBrokerage.HandleError(): RequestId: -1 ErrorCode: 2157 - Sec-def data farm connection is broken:secdefnj 2024-08-11T23:51:08.7178800Z TRACE:: InteractiveBrokersBrokerage.StartGatewayRestartTask(): triggering soft restart
Recent Syslog: L-fe4e90b29ef1bd577aab1c1a05b43731-syslog.txt