About this template
Note: Do not run this bot unattended as there is some risk of assignment. The bot closes all open positions at 3:45 pm every day using exit options. However sometimes the long leg in the credit spread has low or zero value, and has no buyers. In such a case the spread may remain open and there is a small chance of the short leg ending up in the money at close. Please monitor all positions at least 10 mins before close and if necessary close out the short leg from your brokers interface.
____________________________________________________________________________
Updated 9/30/23
This bot is based on the 0DTE Breakeven Iron Condor blog by John Sandvand referenced here https://www.sandvand.net/2023/04/30/how-i-trade-the-0dte-breakeven-iron-condor/
It enters 5 0DTE synthetic Iron Condor positions between 9:45 and 10:45 AM in 15 minute intervals. Each synthetic Iron Condor position consists of 1 short call spread and 1 short put spread.
Sandvand's method uses SPX which is not available on OA. So this bot uses SPY with 10 or 15 delta short positions and $10 wings. I tried using $3 wings but the results were not good.
If VIX is below Min VIX value a 15 delta short position is entered, otherwise 10 delta short position is entered. When VIX is low premiums are low, so the higher delta is used to compensate for this shortfall.
The bot also checks if the market is volatile on any trading day by checking SPY's value relative to its standard deviation. The market is also tagged volatile on FOMC meeting days and CPI release days. On volatile market days only 10 delta short positions are entered as higher volatility increases premiums.
Each spread has an intended stop loss of 100% of credit. The assumption is that if one spread of the synthetic IC is closed at a loss, the other one will close at full profit, hence breakeven.
To account for slippage where some premium is lost in the bid/ask spread, the stop loss for call spreads is set to 85%.
To account for put skew where put spreads are usually richer than call spreads and slippage, the stop loss for put options is set to 75%.
The bot checks if all positions have been filled. If not, it attempts to reopen the unfilled positions.
All positions are closed 15 minutes before market close.
The optional Dead Man Switch turns off the bot from running every Friday at 3:45 PM. By default it is turned Off. The bot can be restarted through the Dead Man Switch Turn Off button.
The bot will need an allocation of $10,000.