TrendYCMacro (Quantpedia’s market timing strategy)

Quantpedia's TrendYCMacro holds the S&P 500 while its trend is up and the yield curve is not inverted. When either fails, it stays in stocks only while real retail sales, industrial production, and housing starts are all higher than a year earlier, and holds Treasury bills otherwise.

Designed by Ladislav Ďurian and Radovan Vojtko (Quantpedia), 2023. Implemented and tracked by Tactfolio.

1×2×3×5×20082012201620202024
Growth of $1, log scale. Strategy SPY. Hypothetical results on daily ETF prices with trading costs, through Sep 2026.
Mar 2008 – Sep 2026StrategySPY
Annual return (CAGR)9.1%12.2%
Worst drawdown-22.5%-51.5%
Sharpe ratio0.770.68
Volatility12.3%19.7%
Annual return since publication (Sep 2023)6.8%20.7%

TrendYCMacro is a stock market timing strategy from Ladislav Ďurian and Radovan Vojtko of Quantpedia, published in 2023. It combines three families of warning signs: the S&P 500's own trend, the Treasury yield curve, and the growth of the real economy. It holds stocks while the trend is up and the yield curve is not inverted, and while the economy is still growing if either fails.

The idea#

Each signal alone misses some bear markets. Price trend reacts late and whipsaws in corrections. An inverted yield curve warns months before a recession, but its timing is loose. Economic data confirm a recession, but late.

The authors tested these signals on US stocks from 1927 and found that they work best together. Trend and the yield curve decide when to be in stocks. Growth data can then keep the strategy invested through a trend break that turns out to be a correction rather than a recession.

How it works#

At the close of the last trading day of each month:

  1. Trend holds when the S&P 500 (SPY) is above its 200-day average and has beaten Treasury bills over the last 200 days. The paper measures the second part with a Rachev ratio of daily returns over bills, which with its settings is the same as a higher average daily return than bills.
  2. Yield curve holds when the 10-year Treasury yield is above the 3-month yield (FRED series T10Y3M).
  3. Macro holds when real retail sales (RRSFS), industrial production (INDPRO), and housing starts (HOUST) are all higher than a year earlier, using the latest figures as first published.
  4. Hold SPY if trend and yield curve both hold, or if macro holds. Otherwise hold Treasury bills (BIL).

In the paper, macro can only keep a position the strategy already has; it cannot move it back into stocks. The builder has no memory of last month's holding, so in this version good macro data can also bring the strategy back in. That makes it return to stocks sooner after some sell-offs.

What the backtest shows#

The ETF-era test starts in March 2008. Since then it returned about 9% a year, against 12% for the S&P 500 and 8.5% for a 60/40 stock and bond mix. Its worst drawdown was about 22%, against 52% and 32%, and its risk-adjusted return was a little above the S&P 500's and just below the 60/40's.

It gained 1% from March 2008 through that year, while the S&P 500 lost 29%. Its worst drawdown ran from April to November 2011 and was recovered by January 2013. It gave up a lot in 2019 (5% against 31%) and 2023 and 2024 (5% against 26% and 25%): the yield curve was inverted, and with industrial production or housing starts below their year-earlier levels it spent much of those years in bills.

Since publication in September 2023 it has returned about 7% a year.

With simulated fund history the test starts in 1993, when real retail sales begin, and returns about 10.7% a year, almost matching the S&P 500's 10.9% with far smaller losses. From 2000 to 2002 it made 0%, 3%, and 7% while the S&P 500 lost 10%, 12%, and 22%.

When it struggles#

  • Long yield curve inversions. When the curve stays inverted but no recession comes, as in 2023 and 2024, it can sit in bills through a rising market.
  • Mixed economic data. All three growth measures must be positive, so one weak series is enough to turn it defensive when the trend fails.
  • Fast crashes. Trend and growth data both react after the fact.

Using it on Tactfolio#

The live strategy above runs the paper's signals on SPY and BIL with FRED data. Copy it to try fewer macro series or a different trend, or compare it with Growth-Trend Timing, which uses similar growth data with only a trend rule.

Year by year

YearStrategySPY
2026*3.3%14.0%
202510.9%17.7%
20245.1%24.9%
20234.9%26.2%
2022-15.2%-18.2%
202128.7%28.7%
202024.5%18.3%
20194.6%31.2%
2018-4.7%-4.6%
201721.7%21.7%
201617.9%12.0%
20151.1%1.2%
201413.5%13.5%
201332.3%32.3%
201216.0%16.0%
2011-8.4%1.9%
201010.3%15.1%
200914.0%26.4%
2008*0.7%-28.7%

* Partial year.

The rules as implemented

This is the exact tree Tactfolio runs, rebalanced monthly with signals and trades at the close. Open it to inspect or copy it.

  • StrategyTrendYCMacro
    • WeightEqual
      • IfAll of 3 conditions
        • current price of SPY is above 200d moving average of SPY
        • 200d mean daily return of SPY is above 200d mean daily return of BIL
        • 10-year minus 3-month Treasury yield is above 0
        Then
        • WeightEqual
          • TickerSPY
        Otherwise
        • WeightEqual
          • IfAll of 3 conditions
            • 12-month growth of US real retail sales is above 0
            • 12-month growth of US industrial production is above 0
            • 12-month growth of US housing starts is above 0
            Then
            • WeightEqual
              • TickerSPY
            Otherwise
            • WeightEqual
              • TickerBIL

Sources and caveats

  • The trend test is SPY above its 200-day average and a Rachev ratio above 1 on the last 200 daily excess returns; with the paper's 50% tails that ratio exceeds 1 exactly when the mean daily return beats Treasury bills' (BIL), which is how it is built here.
  • The yield curve test is the 10-year minus 3-month Treasury spread (FRED T10Y3M) above zero; the paper uses monthly yields.
  • The macro test is real retail sales (RRSFS), industrial production (INDPRO), and housing starts (HOUST) all higher than a year earlier, the authors' 2023 revision.
  • In the paper the macro test can only keep an existing stock position; the builder has no memory of last month's holding, so here it can also bring the strategy back into stocks, which the authors' rule would wait on.
  • Each economic figure counts only from the day it was first published, and as first reported: at a month end the latest figure is the previous month's, the one-month lag the source describes.
  • Signals and trades use the close of the last trading day of each month, as in the source.

Common questions#

What is TrendYCMacro?#

It is Quantpedia's S&P 500 timing strategy that holds stocks when the price trend is up and the yield curve is not inverted, or when real retail sales, industrial production, and housing starts are all growing, and Treasury bills otherwise.

What is the yield curve signal?#

It compares the 10-year and 3-month Treasury yields. When the short rate is higher, the curve is inverted, which has preceded most US recessions.

How is this version different from the paper?#

In the paper, good economic data can only keep an existing stock position. Here they can also bring the strategy back into stocks, because the builder does not remember last month's holding. The paper's Rachev ratio test is built exactly, as a comparison of average daily returns.

Does TrendYCMacro still work?#

Since publication in 2023 it has returned about 7% a year, held back by the long yield curve inversion. The live record on Tactfolio shows how it is doing now.