5-10-20 Trend-Following Strategy


This is a test of a trend-following system from the (now defunct?) blog Dk Report: the 5-10-20 strategy, hailed by Dk as “perhaps the granddaddy of all market timing systems”. That’s a tall order.

Here I’ll put this granddaddy to the test against a classic trend-follower, 50/200-day moving average crossovers.

Strategy Rules:

Dk applied the strategy to the Nasdaq Composite and I’ll do the same here. Go long at today’s close if both the 5 and 10-day exponential moving average (EMA) cross above the 20-day EMA. Close the position at today’s close when both the 5 and 10-day EMA cross below the 20-day EMA. This strategy does NOT go short.


The graph above shows the Nasdaq (blue) versus the 5-10-20 strategy (red) from 1972. This test is frictionless and assumes a return on cash equal to half the nearest 3-month treasury yield.

And for the number-lovers:


Over the last 37 years, this strategy significantly increased returns and reduced drawdowns and downside volatility with relatively low turnover (4.4 round-trips per year). It hasn’t been a magic bullet, underperforming the market in 16 of those years, but it has sidestepped every major bear turn, including our most recent.

To illustrate, the next graph shows historical drawdowns over the same period for the strategy (red) vs the index (blue).


Finally, the last graph below shows that the 5-10-20 strategy (red) has been much more effective than the classic 50/200-day EMA crossover approach (blue) on this particular index.


Granddaddy? Maybe a bit much. Very good? Most definitely.

In a follow up post I’ll look at the 5-10-20 strategy applied to the Nasdaq 100 (which traders would be much more likely to trade than the full composite) as well as the S&P 500. More to follow.

[Edit: click for a summary of all related posts in this 5-10-20 series]

Happy Trading,

Geek note: there are two generally accepted methods for calculating an EMA that produce slightly different results. DK’s strategy is using the (2 / (Period + 1)) method. If your charting program uses the ((1 / Period) * 2) method, simply increase my period by one. For example, if I’ve used a 10-day EMA, the alternate EMA would use an 11-day EMA.


To stay up to date with what’s happening at the MarketSci Blog, we recommend subscribing to our RSS Feed or Email Feed.

31 Responses to “5-10-20 Trend-Following Strategy”

  1. 1 dskills

    “if both the 5 and 10-day exponential moving average (EMA) cross above the 20-day EMA”

    Does that mean that the cross has to happen on the same day? What if the 5 crosses first and then the 10, say, 5 days later?

  2. 2 dskills

    My more specific question: I tested this as well – and I get a buy near the end of the dot.com bubble. But I don’t get a generated sell signal on the downswing – was curious what that looked like for you.

  3. 3 marketsci

    dskills – sorry about that – you’re right…a little confusing. It should read “if both the 5 and 10-day EMA are ABOVE the 20-day EMA go long” and “if both the 5 and 10-day EMA are BELOW the 20-day EMA go to cash”. Try that and also note the “geek note” at the bottom about the flavor of EMA that DK used, and that I used ^IXIC not ^NDX. If the results still look off, let me know and I’ll dive into it.

    Lovin’ the second set of eyes d.


  4. 4 Alex

    How about a long/short model? I tested a long/short version for 2008 on the S&P 500 and produced a steady return of 83%

  5. 5 enk

    What is the diference between ema 10-20 crossover and ema 5-10-20 crossover?
    The diferece will be just when the fastes ema (5) will close for example below ema 20 and ema 10 will be still above…but this kind of situation appered very rare.

    If you do the same test with just ema 10-20 i think the results will be pretty similar. What do you think?

  6. 6 marketsci

    RE to enk: you’re correct, very little difference. I wrote it up using 5-10-20 because that was the original strategy I learned about, but in one of the follow ups I’ll mention that the 10-20 is essentially the same. Thanks for the comment.


  7. 7 marketsci

    RE to Alex: good question. I’ll include long/short returns in a follow up post. Over the entire test (from 1972) including shorts would have increased returns a bit but also decreased risk-adjusted returns and increased downside volatility. More to follow.


  8. 8 Rok

    Any chance you will post results using an ETF or future instead of an index?

  9. 9 marketsci

    RE to Rok: I’ll add it to the reader request list. Keep in mind though for longer hold-time strategies like this one, applying the strategy to an intraday vehicle vs the index is going to have very little impact on performance. That’s more of an issue with extremely active strategies. More to follow.


  10. 10 Mike

    What about a 5/10/55 strategy? Buy (sell) 1 unit when the 5 crosses the 55 and 2 units when the 10 crosses the 55. Close when the 10 crosses the 55 going the opposite direction. Using the 55 would smooth out the spikes in the 20 esp. now with all the volatility. I’d be interested to see how this compares to the 50/200 and the 5/10/20

  11. 11 Mike

    @Alex: I bet it worked so well in 2008 because it was a seriously trending market. A MA cross strategy got you short in the early part of the year, and most are still short. I would just be careful extrapolating that out because 08 most likely was an anomaly (I hope :-) )

  12. 12 marketsci

    RE to Mike’s 5/10/55 strategy – I dunno’…let’s see. I’ll put it through the paces. More to follow. michael

  13. 13 djg

    Have you compared the results of this strategy with buying at 3-year peaks with a 20% trailing stop?

  14. 14 marketsci

    RE to djg: nope, but I’ll add it to the to-do list. michael

  15. 15 marketsci

    RE to djg: just ran a quick test based on your description. Doesn’t look to be a particularly good strategy. Can you expound a bit? michael

  16. 16 Alan Pendleton

    You can see on the chart of the profit line that there was a significant “regime change” that occurred in 2000 coincident with the Nasdaq high of that year. The profitability of the strategy went from about 17% annually to about 3.5% annually (not including the return on cash), low enough to make you wonder if it’s worth trading. Since the strategy has been in the market only about half the time since 2000, the annualized daily return is around 7% — not horrible, especially these days, but a lot less impressive than the return over the whole period since 1971.
    That said, the strategy definitely beats buy and hold by keeping you out of bear markets. While 5-10-20 was making “only” 3.5% per year Nasdaq has been losing 13% per year.

  17. 17 gregh

    So will you replace your 50/200 crossover on “the state” posts with this 10/20?

  18. 18 marketsci

    RE to gregh: good question, but no. I’ll show in an upcoming post that for the S&P 500, the 50/200 has still been a much better trend indicator. Post should be out in the next 24h. Thanks, michael

  19. 19 marketsci

    RE to Alan: I’ve been thinking a bit about your very insightful comment. I have a bit of a different take on this “regime change”.

    In the case of very short-term strategy (such as the prop. indicators on the State of the Market report), I expect those to be able to pull gains out of any market type: bullish, bearish or sideways.

    But in the case of very long-term trend followers (especially ones that are long-only) that’s not the case. They’re really stuck with whatever the market makes available because they’re just playing broad trends.

    So in the case of very long-term strategies, I think it’s important to show returns relative to what’s being traded. I was going to do a post on this showing data, but I think the point would be missed by most folks. In a nutshell though, if you look at strategy returns over the period tested, on a relative basis, the strategy did very, very well since 2000. If anything, I think the strategy fell down the worse in the late 1990’s. Even though it made money, on a relative basis it underperformed despite the fact that market was giving it everything it needed to succeed.

    Good discussion and would like to hear your thoughts.


  20. 20 dk


    Thanks so much for the reference and interest in the 5-10-20 Timer. Your analysis was excellent and thorough, and the comment string made for good reading as well. An especially nice job with the data.

    I wish I could remember where I first saw the 5-10-20 mentioned. Like the 13-34 weekly, I’ve seen it many places over the years, but my original source escapes me. It was this now-forgotten source that touted its IT reliability over many market cycles, which is why I colloquially offered it “granddaddy” status.

    Yes, I’m on an unscheduled hiatus because of my workload and heavy travel schedule. It has been fascinating watching the current financial crisis unravel from an impersonal hotel room. It has given the meltdown a detached, eerie quality.

    If your interested, I have kept current my Stockcharts public list. It’s an ad hoc assembly of charts (including the 5-10-20 and 13-34) but I do keep them up-to-date. http://stockcharts.com/def/servlet/Favorites.CServlet?obj=ID2287993

    Thanks again.


  21. 21 djg

    re buying on 3-year peak strategy – it is described with some lack of detail in http://worldbeta.blogspot.com/2007/11/capitalism-distribution.html. I am very curious to see a good backtest compared to the 10-50 strategy. Thanks!

  22. 22 marketsci

    RE o djg: I remember reading that article and liking it (it’s on my bookmark list on the right hand side of the website). But if I recall it was referring to individual stocks right? Not indices? Very different animal.


  23. 23 djg

    Indeed, this is for individual stocks. Has anyone done any work to find the optimal S&P 500 trading strategy? I have seen evidence on the same blog that a 30/300 SMA strategy outperforms the 50/200.

  24. 24 marketsci

    RE to djg: in my humble opinion, there’s way too much of this “what about a 30/300-day, 39/84-day, 59/206-day, etc. etc.” going on. Very long-term moving averages are going to all generally make the same read on the market and the more we fine tune the lookbacks, the more it begins to look like curve-fitting. I think our time is better spent finding something that has been consistent historically (say, 50/200-day crossovers) and then building on top of that with short and intermediate-term indicators. That’s the approach I’ve taken with the State of the Market report. Having said that, a very curve-fitted look at the performance of every conceivable combination would be interesting…on the to-do list =)


  25. 25 marketsci

    RE to dk: no thank you sir for putting such a good strategy out there. If it’s okay, I’m going to run some numbers on some of your other strategies as well because they are similar in spirit to a lot of what I do here (swing trading based on EOD data). More to follow. michael

    P.S. I think I speak for everyone here when I say I hope you get back in the saddle and blog more in the near future!

  26. do your returns include transaction fees?

  27. 28 jg

    I was reading some of the older articles on the site, so sorry for the late post to this thread. As per the recent posts on “The stories of moving averages demise …” I ran this 20/10 strategy (used SMA vs EMA but shouldn’t make a huge difference) through my spreadsheet and got a gain of ~$1428 backtesting to 7/17/1986 (yahoo finance doesn’t go back past 1985 for nasdaq 100) vs buy/hold of $939. This had 327 trades with 89 of them being negative.

    If I used the 179/59 moving average (same as the golden cross thread) and used 19 days for the slope of both averages (only sell if both are negative) I get a gain of ~$4010 with only 23 trades (5 being negative). So the longer moving averages trounces the 20/10 approach, and taking into account taxes/transaction costs the 20/10 would fare even worse.


  28. 29 Jim

    Has anybody done any backtesting with the 5-10-20 trend method with any of the leveraged broad market ETF’s. This would be an interesting exercise, would love to know how this might magnify the returns. the SSO 2X S&P500 and the MVV 2X Midcap 400. are great candidates for investigation, albeit they have only been around since around 2006.
    Thank you MarketSci.

  1. 1 Tuesday links: crossover calls « Abnormal Returns
  2. 2 Trading Strategy: The 5-10-20 Trend Following Strategy - InformedTrades

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s