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

IB realtimeBar subscription stops during the trading session due to bust events #3

Open
vladisld opened this issue Mar 25, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@vladisld
Copy link
Owner

vladisld 24 Jan 2020, 17:57

Please see my post in "TWS API Users Group": https://groups.io/g/twsapi/topic/69943076

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.-

Currently backtrader doesn't process the bust event error code (10225).

I've submitted PR with a fix: mementum#396

(bwt this PR also fixes the issue with multiple strategies and data feeds: https://community.backtrader.com/topic/2122/live-trading-multiple-strategies-each-one-on-a-separate-data-feed, although it could be separated into its own PR if at all)

@vladisld vladisld added the bug Something isn't working label Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant