Example of Mean Reversion Trading Strategy

Adrian Reid presents a practical example of a complete mean reversion trading strategy and demonstrates an Amibroker backtest on Canadian stocks. He explains the strategy rules (trend filter: 200-bar EMA, volatility: ATR/price threshold, liquidity and price filters, RSI(3) entry, two exit rules), position sizing, stop rules and re-entry delay, then shows backtest results from 1990–present on the Toronto Stock Exchange (including delisted stocks). He also emphasizes testing/optimizing strategies to fit the trader and the value of diversification across markets, strategies and timeframes.
Questions this video answers
200-bar exponential moving average (EMA).
Average True Range divided by close > 0.08 (ATR/Close > 0.08).
Average daily turnover over the last 20 days must exceed $1,000,000 per day.
Unadjusted close must be above $5 per share.
RSI with period 3 (RSI3) crossing below a threshold of 5.
Chapters
Hey Adrian, here again. And in this video I want to give you a practical example of a complete mean reversion trading strategy just to tie all of this together. In my previous videos I've talked about what mean reversion is, how it works, what some of the common mistakes are, and some of the best indicators for mean reversion trading. Now what we can do is pull all that together into a strategy that actually works. Now before we go any further, I just want to let you know I don't recommend you trade this strategy straight off the website if you it is profitable in the backtest. But if you want to trade a strategy, you need to do some work on it yourself and learn to back test and optimize and fine tune that strategy to make sure it fits you, your personality, your objectives, your lifestyle. If you need to learn how to do that, then click the link below and join the Trader Success System and I'll teach you all about how to develop, test optimize fine tune trading systems for yourself and how to assemble a portfolio of diversified trading strategies that trade across multiple strategies, markets and timeframes. Having said all that, let's jump in and have a look at this mean reversion trading strategy example. But before we go any further, make sure you hit the subscribe button and give this video a thumbs up so that you get notified of all of my future videos because I've got new trading content coming out all the time and I don't want you to miss a thing. So first I'm backtesting this strategy today in amibroker. So what I'm going to do is just show you the rules real quick in the code. I don't want you to obsess too much about the code. If you haven't used amibroker before, this might be a little daunting, but it's simple enough once you, once you get the hang of it. So let's go through the rules. There's a couple of rules. We've got a trend filter and let me just make this a little bigger so you can read it. A trend filter which says that the price has to be above the long term exponential moving average. And this is a 200 bar moving average. Let's have a volatility filter. Now for volatility I'm using average true range. So I'm saying average true range divided by the closing price has to be greater than 0.08. So this is quite volatile stocks that it's trading. If a stock is really quiet, it's not going to take a signal in that trade. It's requiring stocks that are quite volatile. And the reason is the more volatile the stock, the higher the average profit per trade and the better the system will perform, provided you get enough trades. Okay, so that's the volatility filter. We've also got a liquidity filter which requires that over the last 20 days on average the the stock has turned over more than a million dollars per day. You can make this number higher or lower depending on your account size and how big your positions are going to be. But for the purpose of this exercise, I've set it to a million. I've also set a price filter, so a minimum price. And this is the original unadjusted closing price. So before any adjustment for splits. And the share price has to be above $5 per share because I don't want to trade penny stocks with this because the commission drag gets too high. And then finally the entry trigger. And we're going to enter when the RSI3 crosses below a certain threshold, which in this case is 5. So when the RSI3 crosses below A value of 5, we're going to enter, provided these other rules are true. There's a couple of sell rules. We're going to sell if the closing price crosses above the three bar exponential moving average. So that's just a little uptick, a little rally after we enter and then we're going to get out. We're also going to exit if the close closes below the long term moving average. So basically the opposite of this trend filter. If that trend filter is no longer true, then we're going to get out because we don't want to be holding a long position in a mean reversion strategy in a downtrend that's very, very dangerous. So you can see here I pull all of the rules together. We've got the trend filter, volatility filter, liquidity filter and entry trigger and the two sell rules. We've also got a position score rule. The position score is the rule that ranks trades. So if you get more signals and you've got available capital, then the trade with the highest position score gets the capital first and you go down the list in order of highest to lowest position score. That way you don't have to make any subjective decisions about which trades you take and which ones you don't. Then I've got a stop loss. This is initial stop loss, which is 40% wide. So this really is a disaster stop. And if that 40% stop loss gets hit, we're not going to re enter that trade for five days. So we've got a five day reentry delay because what happens is if the stop loss gets hit, that's because the stops here, the stock is falling and the price gets hit. That's typically at a point where the stock is heavily oversold. And if you don't have a reentry delay, the very next day you're going to get a buy signal. And what can happen is you have an oversold stock, you buy it and then it hits the stop loss. Then you buy it again and then it hits the next stop loss and you buy it again and it hits the next stop loss. You don't want to be constantly chasing good money after bad. So that's why I've got a reentry delay. Just if the stop loss gets hit, you let it cool down for a little bit. Then if it goes oversold, then you can buy the stock again. And then position sizing is a simple 10% of equity position size. So 10 equal positions in this system. So that's the rules. What I'm going to do is I'm going to send that to the analysis window now and I'm going to run a backtest. Now what market are we trading it on before we go any further? And you're probably thinking, oh, this is AN S&P 500 system. And actually no it's not. Because a lot of mean reversion trading strategies, particularly ones that enter at the open, have really lost their edge. They've really decayed over the last decade or so in the, in the US markets in particular, at the top end of the US markets, there are still mean reversion strategies that work in those markets. But I've chosen to demonstrate this system on the Canadian markets. And the reason is there's more stocks that are volatile. Mean reversion still works really, really well. And I think it's because there's, there's much less automated high frequency trading in Canada because you're not allowed to do a lot of the things there that you are in the US and so if you have this system, you apply to the Canadian markets. It works really well as I'm going to show you. So let's have a look. So I'm going to run a backtest. I've applied this to all stocks on the Toronto Stock Exchange and the delisted stock. So it includes delisted stocks. There's no survivorship BIA in these results. Let's run a backtest and see what Happens. I'm running it from 1990 to today. Now, this is really important. I haven't optimized or fine tuned this system at all. I kind of just made up some rules that seemed logical. I tinkered a little bit just to get it functional, and now I'm sharing it with you. So if you want to trade a strategy like this, you could pick this one up, but you're going to need to do some work on it. It could be made much, much better with a small amount of effort. So I've done the backtest. Let's have a look at the results. Okay.
So we'll go to the stats first. So look, as expected, this is not stellar, not sensational. It's not going to shoot the lights out because I've basically just pulled these rules out of the air and presented them to you today. But the annual return for this strategy is 6.7% and it's only in the market 1% or 1.3% of the time. So that means you're making 6.7% return. You're only invested less than 2% of the time your money is in the market. So that's pretty good. The risk adjusted return for this strategy is really, really high. 517% risk adjusted return is annual return divided by exposure. So for the time it's in the market, it makes really good returns. It's got 402 trades, 69% of those were profitable. And the average profit per trade was 5.68%. So one of the great things about the Canadian market and also trading volatile stocks is you do get much better, higher average profits per trade than in some other markets. And the max drawdown for this strategy, for this system was.
9%. And so the car over max drawdown is 0.73. Again, look, not spectacular, but it's a pretty good starting point. Let's have a look at the equity curve. And you can see from 1990 to today that the equity curve has been on a steady uptrend. It hasn't really. It doesn't look like it's decayed too much. There was a big rally in 2000s. This is the same equity curve. The top one is on linear scale, the bottom one's on a log scale. That's why it looks a little bit different. But basically, the slope of this equity curve on a log chart has been more or less linear since after the tech bubble burst. And that to me says that the strategy is fairly stable. It hasn't really lost its edge, which is great. The drawdown profile is again, relatively stable. We've had a couple of drawdowns around the 7% level and then more recently in Covid a drawdown just a little under 9% or a little over 9% by the look of it. So not too bad, pretty good starting point. So this is a mean reversion trading strategy that you could pick up and adjust and adapt and maybe apply it to some different markets and see what happens. But one of the, one of the big lessons here is, you know, you don't want to get stuck just thinking about your own home market. If you're a US trader, you think, well, I only trade stocks in the S&P 500. You're really potentially leaving a lot of money on the table. You can get some great diversification by going offshore into other markets that it's super easy to trade internationally. And also by trading different strategies in different time frames as well as different markets, you can really improve your results. And that's exactly what I do. What I teach in the Trader Success System. I show traders how to develop and implement portfolios of trading systems that give them diversification across different strategies, different markets, and different time frames. And I also put you in the driver's seat by not only giving you systems, but by showing you, teaching you exactly how to evaluate those systems to make sure that they're profitable and that they fit you and your objectives. The whole goal is by the end of the Trader Success System, you've learned how to fully evaluate any trading system, not just mine, but one you find in a book or someone else's course or online somewhere. You've learned to evaluate it and test it to build confidence about whether or not you want to trade it. And then you know how to incorporate it into your portfolio so that you can get a diversified portfolio across different strategies, different markets, different time frames. Because diversification is the magic in systematic trading. If you can diversify in many different ways, then you're going to make much smoother returns and much higher returns with lower risk, lower drawdown than you would if you only trade a single market. So if that sounds like something you want to learn, click the button below and apply to join the Trader Success System and I'll guide you from wherever you are today to mastery of systematic trading with a diversified portfolio of trading strategies. I hope you've enjoyed this series on mean reversion trading strategies. Click the link below. Join the Trader Success System and I'll see you on the inside. Bye for now. It.











