About this template
Another 0 DTE bot I know…but you can easily adjust the expirations for something further out. This one opens broken wing butterflies using MACD to determine whether the trend is bullish or bearish.
MACD is set to be a bit more sensitive to changes. Current numbers are: (2,5,3) No idea if those are the best. It needs to be sensitive to change but not so much that the bot flip flops back and forth multiple times a day. I’ve experimented a bunch and those numbers seem to be pretty decent.
For the broken wings with a bullish position: long call is .35 delta and long put is -.10; bearish position: long put is -.35 delta and long call .10
Mornings up until ~noon will open the closest expiration. After noon, it will open positions that expire a few days out.
If a position is challenged (greater than 20% premium; bearish position, short call is greater than .68; bullish position, short put is less than -.68) the bot will cut the position and look for re-entry.
There is also a Bollinger switch. The Bollinger is set to (20,2). If SPY is bullish (like it was today) and hits that Bollinger the bot won’t open the bullish broken wing. That happens whether the switch is on or off.
If the switch is on, the bot will open a bearish broken wing. Today it worked perfectly but opened more positions that I wanted so I still have to work on the logic for that part. Here’s what it did today after hitting the upper band and opening bearish positions.

The bot does best when the market is in a clear trend for at least a couple days in a row. Biggest drawdowns happen when we’re in a bullish trend and gap down to bearish overnight. Same vice versa, which seems to be happening a lot lately.
Here’s how its done overall with both SPY and IWM over the past couple months. I think with a bit more tweaking it can do much much better.

