- Speaker #0
Hello, welcome back to Papers with Backtest podcast. Today we dive into another algo trading research paper.
- Speaker #1
Yeah, and today we're looking at one called Adaptive Moving Averages Used for Market Timing.
- Speaker #0
Right, this is by Dushani Isikov and Didier Marty from the University of Freiburg, originally penned back in 2009, but then revised in 2011.
- Speaker #1
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.
- Speaker #0
They take it quite a bit further, don't they?
- Speaker #1
They really do. They push things in a few ways.
- Speaker #0
Okay, so let's unpack this. First off, looking at moving average rules, but over much longer time frames than you typically see.
- Speaker #1
Exactly. Most studies cap it at maybe 200 days for the long moving average. These guys go up to what, four years?
- Speaker #0
990 days. That's a huge difference. It makes you wonder, are people missing something by only looking short term?
- Speaker #1
That seems to be the question they're asking. Maybe market efficiency looks different when you zoom way out.
- Speaker #0
And they also dig into leverage. So not just if the strategy works, but can you boost it with, say, debt or options?
- Speaker #1
Right. Which adds a whole other layer of complexity and, well, risk, too. Does leverage help or just magnify potential problems?
- Speaker #0
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.
- Speaker #1
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,
- Speaker #0
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.
- Speaker #1
Yeah. Focusing on that profitability, especially for the long term rules and that market timing aspect and of course, how leverage changes the picture.
- Speaker #0
Right. So let's start with the basics, the moving average rules themselves.
- Speaker #1
Okay. So the core idea is pretty straightforward, really. You have a short-term moving average and a long-term one.
- Speaker #0
And the signal comes from the crossover.
- Speaker #1
Exactly. Short MA crosses above the long MA. That's typically your buy signal. Crosses below, that's the sell signal. Simple enough.
- Speaker #0
But they mentioned a bandwidth too. What's that about?
- Speaker #1
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,
- Speaker #0
to avoid getting whipsawed by tiny, meaningless moves.
- Speaker #1
Precisely. Avoids too much noise and unnecessary trading when the trend isn't clear.
- Speaker #0
So they tested a lot of these simple rules.
- Speaker #1
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.
- Speaker #0
Wow. Okay, so what came out of testing all those simple rules? Did the standard ones work?
- Speaker #1
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.
- Speaker #0
So the common wisdom didn't hold up here.
- Speaker #1
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.
- Speaker #0
Twice. OK, that's significant. So looking really long term might actually pay off.
- Speaker #1
It suggests there could be slower, more persistent trends that maybe get overlooked because everyone's focused on the day to day.
- Speaker #0
But these are in sample results, right? There's the risk of data snooping, finding patterns that aren't really there.
- Speaker #1
Absolutely. That's always the caveat with initial back tests. The best rule on that data, but will it work going forward?
- Speaker #0
So did they check how consistent this was over time? They broke the period down, didn't they?
- Speaker #1
They did. Five sub-periods from 1990 right through to 2008. And the story was pretty consistent.
- Speaker #0
The short-term rules stayed bad.
- Speaker #1
Yep. Consistently poor across the board. But the long-term ones, their performance didn't really seem to degrade over time.
- Speaker #0
Even in the later periods, like the run-up to the 08 crisis?
- Speaker #1
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.
- Speaker #0
Yeah. That was brutal for buy and hold.
- Speaker #1
Right. Buy and hold was negative. But most of the EMA rules, except the very short ones, actually generated positive returns.
- Speaker #0
Wow. So those longer trends maybe offered some protection in the crash.
- Speaker #1
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?
- Speaker #0
Good question. They moved on to four more complex adaptive strategies. trying to overcome, you know, just picking one lucky rule.
- Speaker #1
Okay, what were they?
- Speaker #0
First was OPTAL. This one basically looked back every single day at the entire history up to that point.
- Speaker #1
And picked the best simple MA rule from the past.
- Speaker #0
Exactly. It picked the historical best performer and used its signal for that day. Started doing this from 1994 onwards, constantly adapting.
- Speaker #1
Okay, constantly re-optimizing. What else?
- Speaker #0
Then there was OPT4, a bit different. It picked the best simple rule over a four-year selection period.
- Speaker #1
And then used that rule for the next four years.
- Speaker #0
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.
- Speaker #1
Got it. Less frequent adaptation. What were the other two?
- Speaker #0
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.
- Speaker #1
Interesting. A democratic approach among strategies. And the last one.
- Speaker #0
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.
- Speaker #1
How'd it work?
- Speaker #0
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.
- Speaker #1
Ah, so it scales the position based on the strength of the consensus. They're nuanced.
- Speaker #0
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.
- Speaker #1
Right, the moment of truth. What about just directional accuracy first, getting buys and sells right.
- Speaker #0
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.
- Speaker #1
Better than just shorting the market randomly.
- Speaker #0
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?
- Speaker #1
That's where it gets really compelling. Buy and hold returned about 6.16 percent annualized noon return over that period.
- Speaker #0
And the complex strategies.
- Speaker #1
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%.
- Speaker #0
Wow, OPT4 even beat the single best in sample rule.
- Speaker #1
Slightly, yeah. OPT4 hit 14.61%, best was 14.33%. And the random walk, well, it lost money, about negative 8.6% annualized.
- Speaker #0
So these complex adaptive rules really delivered on the return front. What about compounded returns? That's often more important for investors.
- Speaker #1
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.
- Speaker #0
That's a huge difference over 15 years.
- Speaker #1
Absolutely. And here's something else striking. They didn't trade much.
- Speaker #0
Really? With all that adapting, especially OPT all?
- Speaker #1
Surprisingly, no. Over the whole 15 years, the complex strategies only made between 7 and 39 trades in total.
- Speaker #0
7 trades. Over 15 years. That's incredibly infrequent.
- Speaker #1
It really is. Compare that to the random walk strategy, nearly 4,000 trades.
- Speaker #0
So transaction costs wouldn't be a major issue for these complex MA strategies.
- Speaker #1
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.
- Speaker #0
Okay, high returns, low trading frequency, robust to cost. But did they just take on massive risk? What about risk-adjusted returns?
- Speaker #1
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.
- Speaker #0
Meaning they generated excess returns, even accounting for market risk.
- Speaker #1
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.
- Speaker #0
So better returns and better risk-adjusted performance. That's pretty compelling.
- Speaker #1
It really is. It suggests the higher returns weren't just a reward for taking on tons more volatility.
- Speaker #0
And when they looked inside the winning strategies like OPTL and OPT4, did they confirm the importance of those long-term MAs?
- Speaker #1
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.
- Speaker #0
And the best simple rule.
- Speaker #1
Also had a long MA465 days. So the theme holds. Looking way beyond the standard 200 days seems crucial to the success they found.
- Speaker #0
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?
- Speaker #1
Right. They used their new test based on identifying long-term market phases using an algorithm adapted from Pagan and Sosanoff.
- Speaker #0
And did the rules stay long in bull markets?
- Speaker #1
Pretty much. The complex rules were in a buy state for over 90% of the days identified as bull market phases.
- Speaker #0
Okay, that's good alignment. What about bear markets? Did they get out or go short?
- Speaker #1
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.
- Speaker #0
So overall alignment, the total percentage of days the signals matched the market phase.
- Speaker #1
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.
- Speaker #0
And they checked if this was statistically significant, not just luck.
- Speaker #1
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.
- Speaker #0
Interesting. So profitable strategies with statistically significant market timing ability. Now, what about adding leverage? Did that supercharge things? They looked at debt first.
- Speaker #1
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.
- Speaker #0
And how did that affect the complex strategies?
- Speaker #1
It significantly boosted the returns, both mean simple returns and importantly, the compounded returns, even when factoring in realistic borrowing costs.
- Speaker #0
Any standout numbers?
- Speaker #1
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.
- Speaker #0
How did leveraged buy and hold compare? Did it get the same?
- Speaker #1
It also saw higher mean returns, but its compounded returns didn't improve nearly as much, especially with borrowing costs. This highlights something important.
- Speaker #0
What's that?
- Speaker #1
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.
- Speaker #0
Right. Leverage magnifies losses too. And the risk-adjusted performance, alphas.
- Speaker #1
The alphas for the leveraged complex strategies were substantially higher than both the unleveraged versions and leveraged buy and hold.
- Speaker #0
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.
- Speaker #1
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.
- Speaker #0
And the result? High octane returns.
- Speaker #1
High octane volatility, definitely. The options leverage led to huge swings and massive differences between the simple average returns and the compounded returns.
- Speaker #0
So did it actually improve the compounded returns in the end?
- Speaker #1
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.
- Speaker #0
So the conclusion on leverage was?
- Speaker #1
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.
- Speaker #0
Did they look at any other risk aspects, like downside risk?
- Speaker #1
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.
- Speaker #0
Maybe even offered some protection against negative skewness.
- Speaker #1
Potentially, yeah. Like skewness insurance without giving up the returns, which is quite desirable.
- Speaker #0
OK, so let's try and sum this up. What's the big picture takeaway from this paper?
- Speaker #1
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.
- Speaker #0
Which definitely challenges the simple view of the efficient market hypothesis, right?
- Speaker #1
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.
- Speaker #0
Why might these long-term strategies work when shorter-term ones didn't seem to?
- Speaker #1
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.
- Speaker #0
Herd behavior focused on the near term, perhaps.
- Speaker #1
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?
- Speaker #0
Right. Lots more to explore. But definitely a thought-provoking study suggesting value and looking beyond the usual technical analysis horizons.
- Speaker #1
Absolutely. A good reminder to sometimes zoom out.
- Speaker #0
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.