About this template
This is an update to the original template posted here, take a few minutes to read the thread:
https://app.optionalpha.com/community/openforum/post/forward-backtesting-2022081622445
Long story short, I've been collecting position opening, and 15 minute data for 0 and 1 DTE SPY Iron Butterflies since 15 June 2022. The data gathering bot opened the position at 0945, and collects data all the way through to 1545 that same day where it closes the position. As of 10 November 2022, I've got 102 positions worth of data.
I then plugged all the data into Power BI to analyze the results. Power BI analyzes 10,000 different combinations of Profit Taking/ Stop Loss combinations in just a few seconds. The results of the analysis are aggregated and rated based on total P/L, profit factor, and win rate. From there, I use the position opening data to filter out losing trades.
Here are the current entry criteria for the bot as of 11/10/2022:
0 DTE Positions:
SPY Price increase <= 0.3% since open intraday
VIX < 31.5
Profit Taking: 15% (1-minute settings)
1 DTE Positions:
-0.3% since open intraday <= SPY Price change <= 0.3% since open intraday
-2% since close 1 day ago <= SPY Price change <= 0.8% since close 1 day ago
Opportunity Chance of Max Loss < 16%
Profit Taking: 10% (1-minute settings)
Stop Loss: 25% (1-minute settings)
With the criteria above, using the market data collected for the backtest results in 65 positions being opened, with a win rate of 95.4%. Just over half (52.3%) close before noon. If you had been trading this specific strategy since 6/15, the results could look something like the screenshot below. The total P/L is based off a static position allocation of $2500. The profit factor for the example below is 22.2.
Now you're saying to yourself this is too good to be true. This is what paper trading results could look like. I've been live trading this since 21 October, with decent results. Historically, the first day I live trade a bot I take a big loss. This bot was no exception, it seems to be my fate. The only bright side was it got me thinking about how to filter out crazy swinging markets and I immediately updated the entry criteria. Once I got the live bot jitters out of my system, I let the bot do it's thing. Below is the P/L chart for my live bot. It's made back the loss, and is chugging away.
How this bot works:
1. 0945 through 1030, the bot scans for 0 or 1 DTE opportunities. The opportunities are SPY Iron Butterflies at -10/50/10 delta.
2. If the criteria are met, a single IB is opened.
3. 1 minute exit options take care of profit taking/ stop loss.
4. A single monitor checks market time and closes out NLT 3pm for 0DTE positions, and 345pm for 1DTE positions.
The bot is super simple. Not a ton of options to set, not a ton of inputs to modify. One button to close out of positions if you want to take control.
Some notes/ caveats:
1. This bot day trades. If you can't, or don't want to day trade, this bot isn't for you. You can set the bot to only trade 0-DTE positions on Monday/ Wednesday/ Friday, which will result in no more than 3 trades a week...keeping you south of PDT rules. Obviously if you have other bots trading in the same account, be careful.
2. At the moment, I'm only live trading 0 DTE positions. There is a ton more data available, and the positions typically (70%) close out before noon.
3. All SmartPricing settings (opening and closing) are set to Fast at 100% of the bid/ask spread. With the exception of real whacky events, B/A spreads are super tight on SPY and move fast.
4. Everything works until it doesn't. You can be as aggressive as you'd like, but keeping allocations relatively low will prevent your bot from blowing up.
For a deeper explanation of the data model that led to this bot, definitely check out the link in the beginning of this post. Happy trading. Cheers