Build Profitable Mean Reversion Strategy from Scratch in 12 minutes

Are breakout strategies the only way to trade profitably? Not even close.

In this video, We take you behind the scenes and show you how to build a powerful mean reversion strategy using StrategyQuant’s Algo Wizard — step by step, no shortcuts.

📉 Instead of chasing breakouts, we’re doing the opposite:
Buying the dip, selling the rip, and using market logic that most traders ignore.

You’ll learn:

  • ✅ The core logic behind mean reversion strategies

  • 📈 How to detect profitable price deviations

  • ⚙️ The exact conditions and triggers used

  • 💻 Full build-out inside StrategyQuant (no coding needed)

  • 📊 How to backtest and evaluate your edge

  • 🔐 Smart filters like EMA200, minimum price, and rescue exits

🎥 Watch the full video now and start building strategies that actually make sense.

Transcript:

Welcome to another strategy demonstration. In one of the previous videos, I showed you how to put together a simple and effective breakout strategy.
Today, I will show you a mean reversion strategy that works on a completely different logic. Let’s explain it.
According to some iron rule in the financial markets, the red line shows that the price constantly fluctuates around some mean value.
From this value, the price always deviates, returns, deviates again, returns again, and so on and so forth. And it is precisely these deviations that we will trade.
As soon as the price deviates, we will speculate that it will return again. And let’s show it here again.
I look at the chart where I see the stock and its price, and when I connect a trend with a line, like this for example,
then you can clearly see what I mentioned.
Here is the yellow line, which is the median value, and the price always deviates, then returns back, deviates, bounce back, deviates again, returns back, and so on and so forth.
So we will speculate that as soon as the price deviates below the median value, we will place a limit order. We will exit when the price returns to the median value in some way.
Conversely, short trades will be when the price deviates upward and returns to the median value again. The basic rule is that a given candle must make a significant drop.
It must either go down or up by a certain percentage of the daily range. And then, right at that moment, we will place limit orders. Now let’s set it all up in Strategy Quant.
In Strategy Quant, I will switch directly to Algo Wizard and start creating a new strategy. I will be creating a strategy for multiple markets, so I choose stock picker strategy.
Now, the first thing I need to do is set the triggers. We will be placing limit orders before the market opens, so I will set the entry trigger to before bar open and exit triggered at on bar close.
So, the first condition is that the candle must make a significant drop. Let’s say by 3%. This means that for the condition, I select close
is lower than. Now, I will substitute multiplication into the formula. And on the left side of the formula, I select open.
And on the right side of the formula, I will select the number 0.97 because we want a movement of at least 3%, meaning close is lower than open by more than 3%.
The next condition was that close must break through the minimum low in three days. I add another condition.
First of all, I select close.
Close must be lower than
minimum low in three days. And just like this, it’s done. The next thing we need to do is enter end limi- enter a limit order.
This means that as soon as the specified conditions are met, that means, for example, on the chart here where there was a bigger drop, we will enter a limit order.
The order type will therefore be limit. Here, I will delete this condition and select that it will be function minus
close
multiplication
number 0.5
ATR for five days.
I will also enter the exit condition. This means that as soon as the price crosses somewhere here, the trade will start and we will close on the first positive candle.
That is, on the candle where the close is greater than the open.
And finally, we still need to set the position score. We will trade a maximum of five stocks, and I want the deviation to be for stocks with the lowest valuation.
And since the position score is calculated according to the highest value, we will have to reverse it. That said, I will enter the number one
and I want the smallest valuation. So rate of change with a time period of 20.
Then we will trade on the Russell 3000 market because it is volatile and there are many opportunities. Once I’ve got this done, I run a backtest.
And I can see that this strategy has some advantage, some edge, and that there is actually some idea. What I also try is to filter out trades because we only want those on markets that are growing.
So we will set a condition that the close is greater than EMA 200.And we will also add a second condition where we only want to take stocks that are worth more than three dollars, because let’s not take any with a value of 0.5 and the like.
So once again, let’s find close. Close is greater than number three. And again, let’s run the backtest.
We can see that the equity curve has evened out nicely and the drawdown has fallen to less than 3%, which is absolutely great.
Also, um, we should set, uh, let’s call it, like, rescue stop, where we want to exit after a maximum of five days in case the market does not go in our direction so that we can close the position calmly.
And we will simply set an exit after five days. Now I will run the backtest again.
And to be honest, the results have not deteriorated, but we have a rescue stop loss, which is, which is just great. Like this, I save the strategy.
Again, as you already know, how you name the strategy is absolutely up to you, of course. I will choose Mean Rev.
Now it’s time to set up the second option whe- when the market deviates upwards. This means that we will trade short and there will actually be a larger candle again.
The close will break through the highest high and we will, again, roughly somewhere here, let’s say, enter a limit order. So let’s do it.
Because we go for short, this time it will be that the close will be greater than a multiplication of the open, but this time, 3% up.
So let’s find function multiplication. On the left side, there will be open, and on the right side of the formula will be 1.03. Then we have another condition.
The close will be greater than
the highest high in the last three days.
Then we will be in an uptrend again. So I will simply copy that condition here.
And the stock will be greater than three dollars, so I can copy that here too.
Now it will actually be the same, except it will be with a plus, not minus.
So for limit order, I give plus function. And again, some multiplication of ATR. So here we will put, again, multiplication and the value 0.5.
Then ATR for the last five days.
Exit after you want, again, um, after five days, or when the close is lower than the open. So again, let’s find close function is lower
than the open. Simple like this.
Now let’s move on to position score. We will take five stocks again. This time the condition will be the opposite than before.
I want the stock to have the highest possible appreciation, so I choose the opposite condition than in the case of long. So I want ROC, that is rate of change, 20.
Before you run the actual backtest, quickly check everything.
The backtest is done and we can take a look. A beautiful curve, 62% of winning trades, profit factor at 19, shape ratio on 27. That’s a great result. Now I will take a look at it in more detail.
In the equity chart top, uh, you can see how it looks, long plus short, only long or only short.
And of course, I will also look at trade analysis. The strategy is more or less profitable every year as you can see. The ratio of long to short is balanced, and overall the results are very nice.
In my opinion, this is great. So I save the strategy and let’s go and deploy to AlgoCloud.
I open AlgoCloud, as usual, go to Algo Creator, click on load from file, and find our mean reversion strategy. After loading, I run a backtest to verify that everything is working as it should.
The results are the same, so I can deploy the strategy to the account.
I click start trading.
In this step, I check the name and select a trading account. The market is Russell 3000, which is fine. Entry trigger before bar open, and to know this is important, exit on bar close. I click next.
This strategy has a lot of trades, so we can add more percentage from the account, say 30. Once this is done, click next. Check the code and that’s it.
Now I see the strategy deployed in the list and I can start trading it. In the next video, you can look forward to building a portfolio, so like and follow this channel so you don’t miss it.
Thank you for your attention, guys, and see you next video.

Tomas Vanek

Tomas Vanek, founder of QuantMonitor.net, is a visionary in automated trading. Driven by a passion for efficiency in finance and data, he created QuantMonitor.net to offer robust Algo Trading solutions, simplifying trading strategy building, management for traders of all levels with advanced templates and tools.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Continue reading