Skip to content

Commit 954ed26

Browse files
committed
Don't roll an ITM put up
If we're rolling a put that's ITM, it can sometimes result in rolling up to high strike, which is undesirable. Thus, we limit the strike such that it must be less than or equal to the current put's strike.
1 parent dc4226f commit 954ed26

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

thetagang/portfolio_manager.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,6 +1463,11 @@ def roll_positions(
14631463
),
14641464
2,
14651465
)
1466+
# special case: if we're rolling a put that's ITM, we want to roll to an equal or lower strike, not higher
1467+
if isinstance(position.contract, Option) and self.put_is_itm(
1468+
position.contract
1469+
):
1470+
strike_limit = min([strike_limit, position.contract.strike])
14661471

14671472
kind = "calls" if right.startswith("C") else "puts"
14681473

0 commit comments

Comments
 (0)