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

Problem when running example "historic_data" #130

Closed
jorgemanrubia opened this issue Nov 20, 2018 · 3 comments

Comments

@jorgemanrubia
Copy link

commented Nov 20, 2018

I am trying to run the example at example/historic_data. I am using latest version from master and IB gateway version 972.

The only change I am making is using apple as the only contract to request historic data for:

contracts = {
    123 => IB::Symbols::Stocks.aapl
}

I am getting this error:

Traceback (most recent call last):
	10: from /Users/jorge/work/ib-ruby/lib/ib/connection.rb:357:in `block in start_reader'
	 9: from /Users/jorge/work/ib-ruby/lib/ib/connection.rb:284:in `process_messages'
	 8: from /Users/jorge/work/ib-ruby/lib/ib/connection.rb:378:in `process_message'
	 7: from /Users/jorge/work/ib-ruby/lib/ib/socket.rb:101:in `decode_message'
	 6: from /Users/jorge/work/ib-ruby/lib/ib/connection.rb:390:in `block in process_message'
	 5: from /Users/jorge/work/ib-ruby/lib/ib/connection.rb:390:in `new'
	 4: from /Users/jorge/work/ib-ruby/lib/ib/messages/incoming/abstract_message.rb:180:in `initialize'
	 3: from /Users/jorge/work/ib-ruby/lib/ib/messages/incoming/historical_data.rb:38:in `load'
	 2: from /Users/jorge/work/ib-ruby/lib/ib/messages/incoming/abstract_message.rb:200:in `load'
	 1: from /Users/jorge/work/ib-ruby/lib/ib/messages/incoming/abstract_message.rb:163:in `check_version'
/Users/jorge/work/ib-ruby/lib/ib/errors.rb:43:in `error': Unsupported version 123 received, expected 3 (IB::Error)

I can change the ticker id to 3 to remove the error (although that does not make much sense):

contracts = {
    3 => IB::Symbols::Stocks.aapl
}

And then, while no error raises, it does nothing either. The output is:

Connected to server, version: 137,
 connection time: 2018-11-20 12:35:25 +0100 local, 2018-11-20T12:35:25+01:00 remote.
No subscribers for message IB::Messages::Incoming::ManagedAccounts!
Got next valid order id: 1.
TWS Warning 2106: HMDS data farm connection is OK:ushmds

******** Press <Enter> to exit... *********

I didn't have trouble running other examples (market data, portfolio, real time data...).

I'd appreciate any tip you may have about how to fix this.

Thanks

@topofocus

This comment has been minimized.

Copy link
Contributor

commented Nov 20, 2018

Thanks for your notice.
You are right. The HistoricalData-Message has changed.
In the recent API, the version-Field is gone.
ib-ruby complains correctly about the missleading value.

I wlll update an update after writing some later today.

@topofocus

This comment has been minimized.

Copy link
Contributor

commented Nov 20, 2018

should work now!

@jorgemanrubia

This comment has been minimized.

Copy link
Author

commented Nov 21, 2018

It works like a charm now! Thank you so much for the super-fast fix 🙏🏻.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.