ranaroussi / ezibpy

ezIBpy, a Pythonic Client for Interactive Brokers API
Apache License 2.0
324 stars 116 forks source link

example history.py runs with errors #20

Open josefstr opened 6 years ago

josefstr commented 6 years ago

I'm running the history.py example with contract = ibConn.createStockContract("AAPL", exchange="NYSE") or contract = ibConn.createFuturesContract(symbol="FDAX", exchange="DTB", currency="EUR", expiry="201709")

I don't get any data, I just get the following errors:

Server Version: 76
TWS Time at connection:20170907 14:37:29 CET
2017-09-07 14:37:30,379 [ERROR] ezibpy: [#2107] HMDS data farm connection is inactive but should be available upon demand.ushmds.us
2017-09-07 14:37:30,380 [ERROR] ezibpy: [#2107] HMDS data farm connection is inactive but should be available upon demand.ilhmds
2017-09-07 14:37:30,380 [ERROR] ezibpy: [#2107] HMDS data farm connection is inactive but should be available upon demand.euhmds
2017-09-07 14:37:30,380 [ERROR] ezibpy: [#2107] HMDS data farm connection is inactive but should be available upon demand.ushmds
2017-09-07 14:37:31,383 [ERROR] ezibpy: [#321] Error validating request:-'a0' : cause - Invalid account code '0'.
2017-09-07 14:37:31,385 [ERROR] ezibpy: [#321] Error validating request:-'bm' : cause - Please enter exchange

I'm connecting to an advisor account.

theblankneverloses commented 6 years ago

I don't think the history portion of his code ever worked.

rossdem699 commented 6 years ago

Did anybody get a resolution to this? I have had some very mixed results with getting data. Usually it just hangs. My request is - fut_contract = ibConn.createFuturesContract("GF", expiry="201806") [#321] Error validating request:-'bm' : cause - Please enter exchange. any ideas?

asnatm commented 6 years ago

@josefstr did u manage to solve this issue? can u share a code example for getting historical data? highly appreciated!

josefstr commented 6 years ago

@asnatm I didn't start using this tool. So I cannot help you out.

Zephio commented 5 years ago

@asnatm I had a rough solution to this. Do a requesthistoricaldata with no contracts created first so that it prompts for market data then create the contracts, put a sleep for 10 seconds then requesthistoricaldata again.