IBClient is an extension of IbPy. It provides higher layer abstraction APIs to interact with Interactive Brokers TWS. With these APIs, users could access market data, fundamental data, place order and review account using python script instead of TWS GUI.
- Install from source
- download the source code or clone git repo:
git clone https://github.com/chrjxj/ibclient.git
- run
python setup.py install
- change directory to
tests
folder, create a config filetest-acc.yaml
, e.g.
host: localhost
port: 7497
client_id: 666
account: FILL-YOUR-IB-ACCOUNT
starting_cash: 100000
stock:
symbol: 1810
security_type: STK
currency: HKD
exchange: SEHK
sid: 123
price_unit: 0.05
future:
symbol: XINA50
exchange: SGX
expiry: 20200528
tradingClass: CN
- run
python -m unittest xxx_test.py