How can I run live with interactive brokers?
The documentation points me to IbPy, but that is archived, and recommends that I use the library interactive brokers themselves provide. I can't seem to figure out how to get this set up, though. Is there a guide anywhere that can help me? Perhaps someone here could help me out?
AFAIK IBPy can be used in BT to trade live with IB, despite a few errors (some seldom and random disconnections on error 1100 etc)
On my side, the test I have done on paper account show no major issues.
IBPy can be used in BT to trade live with IB
@emr how though? Is there some sample code that I could look at?
I figure that I could do something like the below, but I haven't been able to test that as yet:
import ibpy ibpy.serve(port = 9939, host = 'localhost')
@heywhat For me, snippets of code from the live training doc works fine. What did you took from the doc that is not running fine on your side ?
ibstore = bt.stores.IBStore(host='127.0.0.1', port=7496, clientId=35)
I was wondering where I'd get the host, port, and clientId from. I can't figure that out from the IB docs here: https://interactivebrokers.github.io/tws-api/initial_setup.html
@heywhat host is the host IB is running on (127.0.0.1 if you run IB & BT on the same computer). Port is "socket port" in the picture in the link you just gave. Usually, 7496 for live (real) trading, and 7497 for paper trading but check on TWS if this is really the case on your platform. ClientId is your choice, this parameter exist to be able to connect different programs to IB. Please note that clientid 0 is a special kind of API connection (master one, see IB API's doc)