ranaroussi / ezibpy

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

historicaldata #7

Closed thomaschen2019 closed 7 years ago

thomaschen2019 commented 7 years ago

I am very new to this and I tried with

ibConn = ezibpy.ezIBpy()
ibConn.connect(clientId=4, host="localhost", port=7496)
contract1 = ibConn.createStockContract("BAC")
ibConn.requestHistoricalData(resolution = "5 mins", lookback ="2 D", csv_path = '~/Desktop/5mindata/')

then i got

2016-12-13 00:46:44,667 [ERROR] ezibpy: [#321] Error validating request:-'bh' : cause - Please enter exchange

sometimes after this msg pop up i still can get the data in csv file but sometime it doesn't work.

ranaroussi commented 7 years ago

I ran your code without problems.

Can you try running the code again, but this time be more specific when creating the contract and specify the exchange (via exchange=...)?

ranaroussi commented 7 years ago

Closing this for now...