Let's build an Intraday RSI trading system. I've spent a reasonable amount of time exploring trading systems based upon two-period RSI. But can we create an intraday system with this indicator? Let's try.
There are many articles on this site about the popular 2-period RSI strategy popularized by Larry Connors. Not to beat a dead horse, but I'm going to put a spin on the strategy. Traditionally, the strategy is trading on the daily bar of the S&P500. Inspired by the video, "Larry Connors RSI-2 Trading System: Adapted to higher performance", I wanted to see if I could create a viable strategy on intraday data.
As a reminder, the 2-period RSI strategy buys the S&P500 when there is a pullback in price. The trade is closed when price snaps back as measured by the RSI. Thus, this strategy is a short-term mean reverting strategy. It's also a long-only strategy. Below are the rules to buy and sell.
2-Period RSI Strategy Rules
Here are the rules for the strategy:
- Buy when 2-period RSI is below 20
- Exit when 2-period RSI rises above 80
The original rules also included a regime filter. Typically, a 200-bar simple moving average is used to divide the market into a bullish/bearish regime and trades are only taken during a bull regime. I'm going to ignore the regime filter for our testing.
All the tests within this article are going to use the following assumptions:
- Backtest Date: January 1, 2006, through December 31, 2020
- Slippage and Commissions: $30 per round trip
- Starting Equity: $100,000
- Size: 1 contract per trade
- There are no stops
Below is a chart of what this system would look like, along with the system results. You can click on the images below to see an enlarged version.
For just a couple of rules, it does well. On the negative side, we can see there are some hefty drawdowns. The strategy got hit over the last couple of years and has not made a new equity high since 2018.
Adding a Volatility Filter
Based upon the StatOasis video, it seems a volatility filter may help remove unproductive trades. So, I did some testing using the VIX. I decided on a straightforward test.
- Only take trades when VIX is above 20.
Not a huge improvement but we are cutting the number of trades by about half while slightly reducing the net profit. We're also increasing the profit per trade, reducing drawdown, and increasing the profit factor. Might there be a better filter to use? Sure. I'll leave that up to you to explore.
Creating The Intraday Strategy
Let's move the strategy over to a sixty-minute bar. I'll use data3 (E-mini S&P daily) to determine when a trade setup occurs and use data2 (VIX daily) to filter trades. We'll also have to move the VIX information to data2 and place the E-mini S&P daily data on data3.
I've been building strategies for the E-mini S&P for over ten years. Thus, I know that entering trades at the close of the day after a pullback can be profitable. So, I'm going to enter trades at 1800.
I also want this to be an intraday strategy. So, I'm going to remove the traditional 2-period RSI exit in favor of holding the trade for X bars. With some experimentation, I determined about 8 bars (8 hours) hold time as decent.
Adding $1,000 Stop Loss
It often pays to have a large stop with mean reversion strategies. But during my testing, I was surprised that a relatively small stop loss of $1,000 looked interesting.
Adding $3,500 Stop Loss
Here is what the strategy would look like with a $3,500 stop loss.
I was not too confident that this would work out when I started down this path of an intraday 2-period RSI strategy. However, I'm pleasantly surprised by the results. In the backtest the strategy is making well over $100 per trade and the drawdown is low. The next step for this strategy is to test it on unseen data (validation). This validation will happen on price data after December 31, 2020. Will it hold up? We'll have to see.
The code is available to all subscribers of EasyLanguage Mastery. Feel free to explore more ideas with this strategy and let me know if you find anything worthwhile.