Professional Documents
Culture Documents
Mean Reversion Entry Timing - Alvarez Quant Trading
Mean Reversion Entry Timing - Alvarez Quant Trading
2018, 23*46
One of the first tests I did when I got AmiBroker twenty years ago was a
mean reversion test. It was a classic set up, a stock in an uptrend, followed
by a pullback. But the entry differed from what I do now. The entry waited
for a confirmation of the trend back up. The trade would enter when the
stock crossed above the previous day’s high. The exit was also different.
The exit was on a close below the lowest low of the last (2,5) days. The
results were not very good, so I gave up on it. I did not do test entering on
the open or on further intraday pullback or exiting on the bounce. If I had,
I would have started my mean reversion trading several years earlier,
which would have added several more years of large edges trading. Oh
well, I was just a beginner researcher then.
The Setup
Testing was done from 2007 to 2017.
https://alvarezquanttrading.com/blog/mean-reversion-entry-timing/ Strona 1 z 10
Mean Reversion Entry Timing – Alvarez Quant Trading 07.10.2018, 23*46
On setup, we have one of three ways of entering: on the next open, intraday
selloff, intraday trend resumption. Signals are ranked from highest 100-
day historical volatility to lowest. Invest in a maximum of 7 stocks at 14.2%
per position. I forgot how I ranked the signals or position sizing from 20
years ago but this alone could make a big difference.
Exit
https://alvarezquanttrading.com/blog/mean-reversion-entry-timing/ Strona 2 z 10
Mean Reversion Entry Timing – Alvarez Quant Trading 07.10.2018, 23*46
Results
For all the comparisons, we will be looking at the top 5 runs and the
average of those. For space reasons I am not showing the 2007 & 2008
results but they are in the spreadsheet.
https://alvarezquanttrading.com/blog/mean-reversion-entry-timing/ Strona 3 z 10
Mean Reversion Entry Timing – Alvarez Quant Trading 07.10.2018, 23*46
This the standard mean reversion strategy. From here we will compare the
results. The CAR is about where I would expect giving that the strategy is
trading S&P500 stocks. I would expect better results using the Russell
3000. The % winners at 65% and low are Avg % p/l are as expected.
Entry
If previous bar is a set up, then enter at a limit price at the previous
day’s low.
Only place the number of orders so if they all are filled, then will be in
7 positions. No leverage is used.
Exit
https://alvarezquanttrading.com/blog/mean-reversion-entry-timing/ Strona 4 z 10
Mean Reversion Entry Timing – Alvarez Quant Trading 07.10.2018, 23*46
Results
This really did surprise me. I expected the CAR and the Avg % p/l to be
significantly higher than “Entry on Open, RSI Exit.” The yearly comparison
with “Entry on Open, RSI Exit” is about the same most years. I was
surprised that the Intraday pullback did better in 2017.
https://alvarezquanttrading.com/blog/mean-reversion-entry-timing/ Strona 5 z 10
Mean Reversion Entry Timing – Alvarez Quant Trading 07.10.2018, 23*46
If previous bar is a set up and today the high is greater than previous
day’s high, then enter at the previous day’s high.
Exit
Results
Entry
https://alvarezquanttrading.com/blog/mean-reversion-entry-timing/ Strona 6 z 10
Mean Reversion Entry Timing – Alvarez Quant Trading 07.10.2018, 23*46
Exit
If today’s close is below the (2,5,10,15,20) day low of lows, then exit on
next open
Results
The average CAR being better than the RSI exit surprised me. I was not
expecting this. The higher MDD did not surprise me. The RSI exit had an
average hold of 7 bars vs 21 bars here. Some big differences in the year
return. For 2017 you have 5.60% vs 22.32%. Also notice that with the n-
day low exit we are now have winners at 29% vs 65% for the RSI exit. This
is more like a trend following for % winners.
Entry
If previous bar is a set up, then enter at a limit price at the previous
day’s low.
Only place the number of order so if they all are filled, then will be in 7
positions. No leverage is used.
Exit
https://alvarezquanttrading.com/blog/mean-reversion-entry-timing/ Strona 7 z 10
Mean Reversion Entry Timing – Alvarez Quant Trading 07.10.2018, 23*46
If today’s close is below the (2,5,10,15,20) day low of lows, then exit on
next open
Results
The surprises keep on coming. The CAR is the highest of all the tests but
then so is the MDD. I was expecting poor performance on this test. Again
the low % winners would make this hard to trade. Look at how slowly the
CAR drops that is a good sign. I must investigate this more.
Entry
If previous bar is a set up and today the high is greater than previous
day’s high, then enter at the previous day’s high.
Exit
If today’s close is below the (2,5,10,15,20) day low of lows, then exit on
next open
https://alvarezquanttrading.com/blog/mean-reversion-entry-timing/ Strona 8 z 10
Mean Reversion Entry Timing – Alvarez Quant Trading 07.10.2018, 23*46
Results
These results are better than expected. I was expecting a negative CAR. But
they are still much worse than the other results. Waiting for the
confirmation that the trend is going back up, costs you. Compare these
results with the “Entry on Open, N-Day Exit” with the CAR almost double.
https://alvarezquanttrading.com/blog/mean-reversion-entry-timing/ Strona 9 z 10
Mean Reversion Entry Timing – Alvarez Quant Trading 07.10.2018, 23*46
Spreadsheet
Fill the form below to get the spreadsheet with all the results and
additional stats. See yearly breakdown and many more value.
Final Thoughts
These tests were full of surprises for me. The most significant one being the
“Intraday Pullback, N-Day Exit.” I must do more research on that. Maybe a
future blog post. What this help remind of is never make assumptions
about what the test results will be. And more important back to old tests.
Sometimes markets change or even more important, we have learned more
about how to enter and exit trades that makes a difference.
https://alvarezquanttrading.com/blog/mean-reversion-entry-timing/ Strona 10 z 10