brndnmtthws / thetagang

ThetaGang is an IBKR bot for collecting money
GNU Affero General Public License v3.0
1.89k stars 248 forks source link

Close contracts if there are no suitable options to roll to #439

Closed brndnmtthws closed 1 month ago

brndnmtthws commented 1 month ago

If you don't like this behaviour, the alternative would be to avoid rolling puts. You can adjust the settings to close the positions when you hit some P&L, and the cycle will continue by writing new puts next time around.

That would be nice if this would work sequentally.

Short explanation what is in my mind: Selling Puts, Underlying increases, rolling will not find a suitable contract (e.g. too low premium) then check if Pnl to close position is reached, and possibly close position. Does that makes sense to you?

Second option would be to reduce the options. The rolling process looks to me to always roll the same amount. But when 3 options now exceed the weight, we could reduce to 2 options.

Btw is there anywhere some room to chat about this stuff? Discord? The Element channel does not seem to work?

Originally posted by @robby28-11 in https://github.com/brndnmtthws/thetagang/issues/347#issuecomment-2142649773

robby28-11 commented 1 month ago

Was just thinking about that function. I think it would be helpfull to have it configurable for each ticket. Something like „roll“, „close“, „roll_or_close“. This way it would also be easy to end the wheel for a ticker and having the mentioned enhancement or the current behavior.

brndnmtthws commented 1 month ago

I like that suggestion, but it's a bit tricky to change while maintaining backward compatibility. I could require people migrate their config, but that will probably annoy some.

For now, I'll probably just add a boolean option to close if it can't roll.

robby28-11 commented 1 month ago

You could define „roll“ as fallback if it is not defined in the ticker, this way it would work as before without the need to change the config.

But just adding the option in general is also a nice first step 👍