Skip to content

Commit

Permalink
add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dchrostowski committed Mar 7, 2024
1 parent c7ebeb4 commit 065b6ed
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 065b6ed

Please sign in to comment.