Playbooks

Mag7 Momentum With a Breadth Gate and a Gold Buffer

Published

The Magnificent Seven led the US stock market for years, and they also fell hard together in 2022. This strategy holds them only when the wider group of large caps is also rising. It buys the strongest few names and puts part of its spare cash into gold. In a daily backtest from January 2021 to November 2026, it returned 269.7%. The benchmark returned 236.9%. The strategy reached this with an average long exposure of only 66%.

How it works

The strategy trades 22 perpetual contracts on daily bars. It can buy only 7 of them: Apple, Microsoft, Alphabet, Amazon, Meta, Nvidia and Tesla. The other 14 large caps are AMD, Broadcom, TSMC, ASML, Oracle, Netflix, Intel, Qualcomm, IBM, Micron, ServiceNow, Costco, Eli Lilly and Alibaba. The strategy never trades them. Together with the Mag7, they show whether the market is healthy. Gold is the 22nd contract. It holds part of the money that is not in stocks.

Scan 21 large caps trend > 0 and momentum > 0? Breadth ≥ 45%? share of the 21 that pass No Sub-book in cash Yes Top k Mag7 by momentum only names in an uptrend, weight 1 / volatility Average 27 sub-books 3 trend × 3 momentum × k = 2, 3, 4 Spare capital half to gold if gold > 100-day mean Rest in cash Rebalance every Monday
Each sub-book follows the steps down to the averaging step. The final portfolio combines the 27 sub-books and then decides what to do with the money that is left over.

1. Two signals per stock

The trend signal checks whether the price is above its moving average. The momentum signal measures the return over the past two, three or six months. It does not count the most recent week.

TL=PtSMA⁡L(P)t−1,L∈{50, 100, 200}T_L = \frac{P_t}{\operatorname{SMA}_L(P)_t} - 1, \qquad L \in \{50,\ 100,\ 200\}
ML=Pt−5Pt−5−L−1,L∈{42, 63, 126}M_L = \frac{P_{t-5}}{P_{t-5-L}} - 1, \qquad L \in \{42,\ 63,\ 126\}

2. The breadth gate

The strategy counts how many of the 21 large caps have both signals positive. If fewer than 45% pass, the market is too weak and the sub-book stays in cash. This gate decides whether to own the Mag7 at all.

B=#{ i:Ti>0 and Mi>0 }21  ≥  0.45B = \frac{\#\{\, i : T_i > 0 \ \text{and}\ M_i > 0 \,\}}{21} \;\ge\; 0.45

3. The pick

When the gate is open, the strategy looks at the Mag7 names that are in an uptrend and buys the k with the highest momentum. Each name is weighted by the inverse of its 20-day volatility, so a calm stock gets more capital than a volatile one.

wi=1/σi∑j∈top k1/σjw_i = \frac{1/\sigma_i}{\sum_{j \in \text{top } k} 1/\sigma_j}

4. Twenty-seven sub-books

The strategy does not choose one trend window, one momentum window and one value of k. It runs every combination: 3 × 3 × 3 = 27 small portfolios, which it averages. Each sub-book controls 1/27 of the capital. So the stock exposure changes in steps of about 3.7%, not all at once.

momentum lookback trend MA 42d 63d 126d 50d 100d 200d sub-book holds Mag7 sub-book in cash Mag7 67% Gold 17% Cash 17%
An illustrative example. Each cell is one pair of trend and momentum windows, and each dot is one value of k (2, 3 or 4). The fastest signals turn off first in a pullback. Here 18 of the 27 sub-books still hold stocks, so 67% of the capital goes to the Mag7. Gold is above its 100-day mean, so it gets half of the remaining 33%.

5. Spare capital and timing

Capital that the sub-books do not use is spare. If gold is above its 100-day moving average, half of the spare capital goes into gold. Otherwise it stays in cash. Once the strategy holds positions, it rebalances only on Mondays. When it holds nothing, it checks every day so it can enter again quickly.

Wi=127∑c=127wi(c),wgold=0.5(1−∑iWi)  if T100gold>0W_i = \frac{1}{27}\sum_{c=1}^{27} w_i^{(c)}, \qquad w_{\text{gold}} = 0.5\Bigl(1 - \sum_i W_i\Bigr)\ \ \text{if}\ T^{\text{gold}}_{100} > 0

Backtest results

The backtest ran on daily bars from 4 January 2021 to 19 November 2026 with $10,000 of starting capital. It held long positions only and used no leverage. The first trade came in July 2021.

+269.69%

Annual return

+24.90%

1.22

Max drawdown

19.28%

+50% 0% +27.9% −6.4% +70.6% +56.2% +35.2% −14.3% 2021* 2022 2023 2024 2025 2026*
Calendar-year returns, compounded from the monthly results. *2021 covers July to December. 2026 runs to 19 November.
Benchmark return236.9%
Average long exposure66.5%
Short exposurenone
Trades1,360
Cost of fees−7.2% of return
Best month+21.7% (Feb 2024)
Worst month−9.5% (Feb 2025)
Months up / down / flat38 / 24 / 3

Most of the gain came in 2023 and 2024, when big tech rallied with broad support from other large caps. The weak spot is the most recent period. From the end of January 2026 to November 2026, the month-end value fell about 18%. That loss accounts for nearly all of the 19.3% maximum drawdown.

Why it works

Breadth tells you what kind of market you are in

The leading mega caps seldom keep rising for long when most other large caps are falling. When fewer than 45% of the 21 names are in an uptrend, the strategy steps aside. Because it uses 21 names instead of 7, one or two strong stocks cannot keep it invested in a falling market. The two years below show the gate at work.

2022 · year −6.4% J F M A M J J A S O N D 2023 · year +70.6% J F M A M J J A S O N D
Monthly returns from the backtest, drawn on the same scale in both rows. In the 2022 bear year for big tech, the worst month was −6.1%. In June, September and October (circles), the strategy held nothing. In 2023 the gate stayed open and the strategy captured the rally, including +17.9% in May.

Momentum within a small group of leaders

Among the largest stocks, the leaders often stay ahead for months. The strategy ranks the Mag7 by their return over two to six months and buys only the top two to four. It skips the last five trading days of each lookback, so a sharp move in the past week does not change the ranking. Short-term moves like that often reverse.

Many small bets instead of one parameter

No single moving average or lookback is the right one. When the strategy averages 27 variants, the result does not depend on one lucky setting. Exposure also moves in small steps as each variant turns on or off. The strategy gets out gradually as a trend weakens and gets back in gradually as it recovers. The average long exposure of 66.5% shows that the strategy was often partly invested.

Volatility weighting and a gold buffer

Inverse-volatility weights give a large position only to a calm stock. A volatile name such as Tesla or Nvidia gets a smaller weight when its price swings widely. The spare capital does not just sit idle. Gold often moves independently of tech stocks, and the strategy holds it only while gold is in an uptrend. This adds return in some of the periods when the stock side is partly in cash.

Where it struggles

  • Choppy markets. In 2026 the trend filters did not keep the strategy out of a slow decline. It lost 14.3% in that year, and its rebalance only on Mondays limits how fast it can react.
  • Hindsight in the universe. The list of seven stocks was chosen with today's knowledge of which companies became the giants. A strategy that picked its names in 2021 might have done worse.
  • Costs. With 1,360 trades, fees reduced the total return by about 7.2 percentage points.

Ideas to test next

1. Put all spare capital into gold

On average, about a third of the capital is not in stocks. When gold is in an uptrend, half of that spare capital still sits in cash. This test puts all of it into gold when gold is above its 100-day mean. It could add return when the stock side is partly out. It could also deepen the losses when gold and stocks fall at the same time.

2. Check the gate every day for exits

The strategy checks the market only on Mondays, so a sharp fall in the middle of the week can run for days before it reacts. This test keeps the weekly rebalance but adds a daily exit. If breadth drops below the gate on any day, the strategy sells its Mag7 positions at once. This could reduce losses like those of February 2025 and 2026. It will also mean more trades and more whipsaws.

Built by an AlphaPilot user. Historical backtest results do not predict future returns. Not investment advice.