Skip to content

Commit

Permalink
Merge branch 'option_trades'
Browse files Browse the repository at this point in the history
  • Loading branch information
dchrostowski committed Mar 7, 2024
2 parents 472be5b + 065b6ed commit 361f284
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions example.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,12 @@
first_option_contract = p.option_portfolio[0]
symbol = first_option_contract.symbol
quantity = first_option_contract.quantity
# close out first option contract in portfolio
first_option_contract.close()
client.refresh_portfolio()
p = client.portfolio
for oo in p.open_orders:
# cancel order to close out contract
if oo.symbol == symbol and oo.quantity == quantity:
oo.cancel()

Expand Down

0 comments on commit 361f284

Please sign in to comment.