Skip to content

Commit

Permalink
Annoyingly, DTE can sometimes go negative
Browse files Browse the repository at this point in the history
  • Loading branch information
brndnmtthws committed Jul 19, 2023
1 parent 5b73bbb commit 52d6542
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions thetagang/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@ def net_option_positions(symbol, portfolio_positions, right, ignore_zero_dte=Fal
if isinstance(p.contract, Option)
and p.contract.right.upper().startswith(right.upper())
and (
not ignore_zero_dte
or option_dte(p.contract.lastTradeDateOrContractMonth) > 0
(
not ignore_zero_dte
or option_dte(p.contract.lastTradeDateOrContractMonth) > 0
)
or option_dte(p.contract.lastTradeDateOrContractMonth) >= 0
)
]
)
Expand Down

0 comments on commit 52d6542

Please sign in to comment.