You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 14, 2024. It is now read-only.
Unfortunately, our dear brother Ewald de Wit passed away monday, March eleven as a result of a serious illness last year.
Although we were not involved in his activities on this platform, we felt the due to inform you.
We thank you for knowing him.
Maritza and Philippe de Wit
Introduction
The goal of the IB-insync library is to make working with the
Trader Workstation API
from Interactive Brokers as easy as possible.
The main features are:
An easy to use linear style of programming;
An IB component
that automatically keeps in sync with the TWS or IB Gateway application;
A fully asynchonous framework based on
asyncio
and
eventkit
for advanced users;
Interactive operation with live data in Jupyter notebooks.
A running TWS or IB Gateway application (version 1023 or higher).
Make sure the
API port is enabled
and 'Download open orders on connection' is checked.
The ibapi package from IB is not needed.
Example
This is a complete script to download historical data:
fromib_insyncimport*# util.startLoop() # uncomment this line when in a notebookib=IB()
ib.connect('127.0.0.1', 7497, clientId=1)
contract=Forex('EURUSD')
bars=ib.reqHistoricalData(
contract, endDateTime='', durationStr='30 D',
barSizeSetting='1 hour', whatToShow='MIDPOINT', useRTH=True)
# convert to pandas dataframe (pandas needs to be installed):df=util.df(bars)
print(df)