I am trying out this new python package ib_insync.
https://github.com/erdewit/ib_insync
I ran the python script below;
from ib_insync import *
ib = IB()
ib.connect('127.0.0.1', 7496, clientId=1)
contract = Forex('EURUSD')
bars = ib.reqHistoricalData(contract, endDateTime='', durationStr='30 D', barSizeSetting='1 hour', whatToShow='MIDPOINT', useRTH=True)
# convert to pandas dataframe:
df = util.df(bars)
print(df[['date', 'open', 'high', 'low', 'close']])
I encountered the error IB API from http://interactivebrokers.github.io is required
.
I have already installed IB API ver 9.73.06 under C:\TW_API folder. I am using Windows 10 and anaconda python v3.6 .
Here is a snapshot of my TWS API settings;