Add order submission example script
This commit is contained in:
parent
af92a7647f
commit
f80ae0727e
14
order_submission_example.py
Normal file
14
order_submission_example.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
from datetime import datetime
|
||||||
|
from ibkr import Client, OptionLeg
|
||||||
|
from ibkr.option_type import PUT
|
||||||
|
from ibkr.order_action import BUY, SELL
|
||||||
|
|
||||||
|
client = Client(host = '127.0.0.1', port = 7497)
|
||||||
|
|
||||||
|
symbol, sub_symbol = 'SPX', 'SPXW'
|
||||||
|
expiration = datetime.now()
|
||||||
|
|
||||||
|
short_leg = OptionLeg(symbol, expiration, 4695.0, PUT, SELL, sub_symbol)
|
||||||
|
long_leg = OptionLeg(symbol, expiration, 4645.0, PUT, BUY, sub_symbol)
|
||||||
|
|
||||||
|
client.submit_combo_option_order([short_leg, long_leg], 1)
|
Loading…
Reference in New Issue
Block a user