Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing the issue with TWS API Bust events (err code 10225) #396

Merged
merged 1 commit into from
May 28, 2020

Conversation

vladisld
Copy link
Collaborator

This PR fixes the issue with realtimeBar subscriptions that stop working due to the bust events.

Up to the TWS API v972, IB realtimeBar subscriptions could stop working during the trading session and no error notification was sent to the application. This happens because of what's called 'busts' events.

Quoting the response in "TWS API Users Group" question:

"The busts occur when the datastream is interrupted or modified in the middle of a bar and the subscription is cancelled by the backend. They should be relatively uncommon but unfortunately no can't be avoided completely"

In TWS API v978,a special error code was added to notify the application about the bust event so that the subscription could be renewed. Below is the example of such error message (from TWS Gateway API logs):

15:24:00:896 -> 4-2-16777221-10225-Bust event occurred, current subscription is deactivated. Please resubscribe real-time bars immediately.-

@vladisld vladisld requested a review from mementum January 26, 2020 09:23
@vladisld vladisld requested a review from backtrader February 10, 2020 11:00
@mementum mementum merged commit 26b2654 into mementum:master May 28, 2020
@vladisld vladisld deleted the bust_event_fix branch May 28, 2020 11:10
Grenite pushed a commit to Grenite/backtrader that referenced this pull request Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants