Skip to content

Instantly share code, notes, and snippets.

View chadhumphrey's full-sized avatar
🏠
Working from home

Chad Humphrey chadhumphrey

🏠
Working from home
View GitHub Profile
@chadhumphrey
chadhumphrey / combo_spreads_file.py
Last active July 19, 2022 07:53
Interactive Brokers, python code for combo trades via the IB API
#Reference https://interactivebrokers.github.io/tws-api/basic_orders.html#limitordercombolegprices
def build_combo_contract(info):
contract = Contract()
contract.symbol = 'ACN'
contract.secType = "BAG"
contract.currency = "USD"
contract.exchange = "BOX"
leg1 = ComboLeg()
leg1.conId = info['contractId_0']