Hello,
welcome back to Papers with Backtest podcast.
Today we dive into another algo trading research paper.
Yeah,
and today we're looking at one called Adaptive Moving Averages Used for Market Timing.
Right,
this is by Dushani Isikov and Didier Marty from the University of Freiburg,
originally penned back in 2009,
but then revised in 2011.
And what's really interesting here is how it kind of builds on,
well,
existing research about whether technical analysis actually works.
you know,
makes money.
They take it quite a bit further,
don't they?
They really do.
They push things in a few ways.
Okay,
so let's unpack this.
First off,
looking at moving average rules,
but over much longer time frames than you typically see.
Exactly.
Most studies cap it at maybe 200 days for the long moving average.
These guys go up to what,
four years?
990 days.
That's a huge difference.
It makes you wonder,
are people missing something by only looking short term?
That seems to be the question they're asking.
Maybe market efficiency
looks different when you zoom way out.
And they also dig into leverage.
So not just if the strategy works,
but can you boost it with,
say,
debt or options?
Right.
Which adds a whole other layer of complexity and,
well,
risk,
too.
Does leverage help or just magnify potential problems?
And the third thing,
which I found quite novel,
was their market timing test.
They developed a new way to check if these strategies actually align with,
you know,
the
big picture market moves,
bull and bear phases.
So it's not just about the final return,
but how you get there.
Are you actually timing the major trends or just getting lucky on volatility?
OK,
so for this deep dive,
our mission really is to get a handle on these trading rules they tested.
Look hard at the backtest results.
This was on the S&P 500 from 1990 to 2008.
Yeah.
Focusing on that profitability,
especially for the long term rules and that market timing aspect and of course,
how leverage changes the picture.
Right.
So let's start with the basics,
the moving average rules themselves.
Okay.
So the core idea is pretty straightforward,
really.
You have a short-term moving average and a long-term one.
And the signal comes from the crossover.
Exactly.
Short MA crosses above the long MA.
That's typically your buy signal.
Crosses below,
that's the sell signal.
Simple enough.
But they mentioned a bandwidth too.
What's that about?
Ah,
yeah.
That's like a buffer zone,
maybe 1%.
If the MA is crossed,
but they're still really close,
within that band,
the rule might just ignore it.
Ah,
to avoid getting whipsawed by tiny,
meaningless moves.
Precisely.
Avoids too much noise and unnecessary trading when the trend isn't clear.
So they tested a lot of these simple rules.
Oh,
absolutely.
They went deep.
1876 combinations,
I think.
Short MAs from one day up to 100 days.
And the long ones.
That's the key part.
Long MAs from five days all the way out to that
990-day mark.
And they tested with and without that 1%
band.
Wow.
Okay,
so what came out of testing all those simple rules?
Did the standard ones work?
Well,
no,
not really.
The typical short-term MA strategies,
the ones most people know,
they actually performed poorly.
Many had negative returns in their tests.
So the common wisdom didn't hold up here.
Not in their data set for that period.
But,
and this is the kicker,
the rules using those really long-term MAs,
longer than 200 days,
they showed average returns up to twice the buy and hold return for the S&P 500.
Twice.
OK,
that's significant.
So looking really long term might actually pay off.
It suggests there could be slower,
more persistent trends that maybe get overlooked because everyone's focused on the day to day.
But these are in sample results,
right?
There's the risk of data snooping,
finding patterns that aren't really there.
Absolutely.
That's always the caveat with initial back tests.
The best rule on that data,
but will it work going forward?
So did they check how consistent this was over time?
They broke the period down,
didn't they?
They did.
Five sub-periods from 1990 right through to 2008.
And the story was pretty consistent.
The short-term rules stayed bad.
Yep.
Consistently poor across the board.
But the long-term ones,
their performance didn't really seem to degrade over time.
Even in the later periods,
like the run-up to the 08 crisis?
Especially then,
actually.
They generally beat buy and hold in those later sub-periods.
And get this,
during that last period,
2006,
2008,
which included the Lehman collapse.
Yeah.
That was brutal for buy and hold.
Right.
Buy and hold was negative.
But most of the EMA rules,
except the very short ones,
actually generated positive returns.
Wow.
So those longer trends maybe offered some protection in the crash.
It seems that way.
Suggests a certain robustness.
So,
okay,
these simple long-term rules show promise,
but they're still prone to that data snooping issue.
How did they try to build something more robust?
Good question.
They moved on to four more complex adaptive strategies.
trying to overcome,
you know,
just picking one lucky rule.
Okay,
what were they?
First was OPTAL.
This one basically looked back every single day at the entire history up to that point.
And picked the best simple MA rule from the past.
Exactly.
It picked the historical best performer and used its signal for that day.
Started doing this from 1994 onwards,
constantly adapting.
Okay,
constantly re-optimizing.
What else?
Then there was OPT4,
a bit different.
It picked the best simple rule over a four-year selection period.
And then used that rule for the next four years.
Right.
Applied it for a four-year evaluation period.
And they repeated this cycle,
select for four,
evaluate for four,
across their data.
Kind of a rolling out of sample approach.
Got it.
Less frequent adaptation.
What were the other two?
They involved more of a consensus approach.
Vote was one.
It looked at all the simple rules that beat the market in the previous selection period.
And then the trading signal for the day was whatever the majority of those winning rules were saying,
buy,
sell,
or neutral.
Like wisdom of the crowd,
but only the historically successful crowd.
Interesting.
A democratic approach among strategies.
And the last one.
Partial.
Similar idea to vote.
Finding the rules that worked in the prior period.
But instead of just taking the majority signal,
it calculated a fractional position.
How'd it work?
It averaged the signals,
treating sell as minus one,
neutral as zero,
buy as one.
So if...
say
70% of rules said by and 30%
said neutral,
you might be like 0.7 long.
Ah,
so it scales the position based on the strength of the consensus.
They're nuanced.
Exactly.
Okay,
so these are the four complex strategies.
How did they actually stack up when back-tested from 1994 to 2008?
They compared them against buy and hold,
BH,
a random walk,
or W,
and the single best in-sample,
simple.
Right,
the moment of truth.
What about just
directional accuracy first,
getting buys and sells right.
Well,
for buy signals,
they were slightly better than just being long all the time via buy and hold.
But where they really made a difference was on the sell side.
Better than just shorting the market randomly.
Significantly better.
Yeah.
Which suggests they had some real ability to identify downturns or at least times not to be long.
OK,
makes sense.
But what about the bottom line,
the returns?
That's where it gets really compelling.
Buy and hold returned about 6.16 percent annualized noon return over that period.
And the complex strategies.
All four beat it soundly.
The lowest was OPT all at around
10.7%, and the highest was OPT4 at a pretty impressive 14.61%.
Wow,
OPT4 even beat the single best in sample rule.
Slightly,
yeah.
OPT4 hit 14.61%,
best was 14.33%.
And the random walk,
well,
it lost money,
about negative 8.6%
annualized.
So these complex adaptive rules really delivered on the return front.
What about compounded returns?
That's often more important for investors.
Even better story there,
relatively speaking.
Buy and hold compounded at only 4.41%
annually.
The complex strategies.
They range from 9.25%
for OPT all up to 13.62%
for OPT for.
That's a huge difference over 15 years.
Absolutely.
And here's something else striking.
They didn't trade much.
Really?
With all that adapting,
especially OPT all?
Surprisingly,
no.
Over the whole 15 years,
the complex strategies only made between 7 and 39 trades in total.
7 trades.
Over 15 years.
That's incredibly infrequent.
It really is.
Compare that to the random walk strategy,
nearly 4,000 trades.
So transaction costs wouldn't be a major issue for these complex MA strategies.
Very likely not.
The paper calculated the break-even transaction costs,
how high costs would need to be to wipe out the excess profits over buy and hold.
They were quite high,
ranging from 1.74%
up to over 12%
per round trip for some strategies.
way higher than typical costs,
suggests the profitability is pretty robust.
Okay,
high returns,
low trading frequency,
robust to cost.
But did they just take on massive risk?
What about risk-adjusted returns?
Good point.
They looked at Jensen's alpha and Sharpe ratios.
The alphas were positive and generally larger than buy-in holds,
some statistically significant too.
Meaning they generated excess returns,
even accounting for market risk.
Correct.
And the Sharpe ratios,
which measure return per unit of risk.
They were at least twice as high for the complex strategies compared to buy and hold.
So better returns and better risk-adjusted performance.
That's pretty compelling.
It really is.
It suggests the higher returns weren't just a reward for taking on tons more volatility.
And when they looked inside the winning strategies like OPTL and OPT4,
did they confirm the importance of those long-term MAs?
Absolutely.
The rules selected by OPTL often had long MAs around,
like 6,
15,
6,
165,
even 940 days.
OPT4 also favored long MA665-515,
415 days in different periods.
And the best simple rule.
Also had a long MA465 days.
So the theme holds.
Looking way beyond the standard 200 days seems crucial to the success they found.
Okay,
so profitability looks good.
What about that market timing aspect they wanted to test?
Did the strategies actually align with bull and bear markets?
Right.
They used their new test based on identifying long-term market phases using an algorithm adapted from
Pagan and Sosanoff.
And did the rules stay long in bull markets?
Pretty much.
The complex rules were in a buy state for over 90%
of the days identified as bull market phases.
Okay,
that's good alignment.
What about bear markets?
Did they get out or go short?
They were in a sell state less consistently there,
maybe around 61%
to 74%
of the bear market days.
Not perfect,
but still much better than chance or just staying long.
So overall alignment,
the total percentage of days the signals matched the market phase.
That ranged from 83%
to 88%
for the complex rules.
Better than buy and hold,
which was right about
75% of the time by definition,
always long.
And they checked if this was statistically significant,
not just luck.
Yes,
they used bootstrap analysis.
And it confirmed the results were statistically significant.
It suggests a genuine ability to time these broad,
long-term market cycles.
Interesting.
So profitable strategies with statistically significant market timing ability.
Now,
what about adding leverage?
Did that supercharge things?
They looked at debt first.
Yeah,
borrowing money to invest more.
They simulated borrowing at different rates,
the US prime rate,
the risk-free rate,
and even,
hypothetically,
at no cost.
And how did that affect the complex strategies?
It significantly boosted the returns,
both mean simple returns and importantly,
the compounded returns,
even when factoring in realistic borrowing costs.
Any standout numbers?
Well,
OPT4,
which was already the best performer,
showed really impressive compounded returns with debt leverage,
potentially up to 24 percent annualized if you could borrow for free,
but still substantially higher even with costs.
How did leveraged buy and hold compare?
Did it get the same?
It also saw higher mean returns,
but its compounded returns didn't improve nearly as much,
especially with borrowing costs.
This highlights something important.
What's that?
It suggests the leverage gains in the complex strategies weren't just due to the leverage itself,
but because the underlying strategies had actual forecasting ability,
they avoided some of the big drawdowns that hurt leveraged buy and hold.
Right.
Leverage magnifies losses too.
And the risk-adjusted performance,
alphas.
The alphas for the leveraged complex strategies were substantially higher than both the unleveraged versions and leveraged buy and hold.
OK,
so debt leverage seemed to work well with these strategies.
What about options?
That's usually seen as a more aggressive way to leverage.
Right.
They simulated allocating a portion of the capital,
5%,
10%,
or 15%,
to buying exchange traded call or put options based on the strategy signal.
And the result?
High octane returns.
High octane volatility,
definitely.
The options leverage led to huge swings and massive differences between the simple average returns and the compounded returns.
So did it actually improve the compounded returns in the end?
It was mixed.
For OPT4,
allocating up to 15%
in options did boost the compounded return,
reaching over 19%
annualized.
But for OPT all,
the performance actually got worse,
turning negative with the higher option allocations.
The volatility drag was just too much.
So the conclusion on leverage was?
Debt leverage seemed much more suitable for enhancing these particular long-term MA strategies.
It provided a significant boost without the extreme volatility introduced by options.
Did they look at any other risk aspects,
like downside risk?
Briefly,
yeah.
They mentioned things like downside upside betas,
Soutino ratios,
even cost skewness.
The results generally suggested that complex strategies,
especially with debt leverage,
didn't necessarily increase downside risk.
portionally to the returns.
Maybe even offered some protection against negative skewness.
Potentially,
yeah.
Like skewness insurance without giving up the returns,
which is quite desirable.
OK,
so let's try and sum this up.
What's the big picture takeaway from this paper?
Well,
I think the main point is that these complex moving average rules,
especially the ones using those unusually long look back periods,
seem to show significant,
robust profitability and market timing ability,
at least on the S&P 500 during their test period 1994-2008.
Which definitely challenges the simple view of the efficient market hypothesis,
right?
It does.
Particularly the idea that simple technical rules can't beat the market.
These findings suggest maybe they can,
if you look long-term enough and combine them intelligently.
And the fact that debt leverage amplified these profits further strengthens the case.
Why might these long-term strategies work when shorter-term ones didn't seem to?
The
Paper kind of hints that maybe most market participants are just too focused on the short term,
on the noise.
They might be creating inefficiencies or trends over longer horizons that aren't being fully exploited.
Herd behavior focused on the near term,
perhaps.
Could be.
Or maybe institutional constraints,
performance pressures.
It's hard to say for sure.
The authors themselves suggest more research is needed.
Like what?
Developing maybe even stronger statistical tests to really confirm these findings aren't just elaborate data mining.
And testing these ideas over longer time periods and,
crucially,
in other markets too.
Does this work for bonds or commodities or international stocks?
Right.
Lots more to explore.
But definitely a thought-provoking study suggesting value and looking beyond the usual technical analysis horizons.
Absolutely.
A good reminder to sometimes zoom out.
Indeed.
Well,
that brings us to the end of this deep dive.
Thank you for tuning in to Papers with Backtests podcast.
We hope today's episode gave you useful insights.
Join us next time as we break down more research.
And for more papers and backtests,
find us at https.paperswithbacktests.com.
Happy trading.