Trend macd

MACD Crossover

Bullish: MACD line crosses above signal line. Bearish: MACD line crosses below signal line.

Signal family

Trend — Signals that fire when price is continuing or reversing an established directional move. Momentum-following by nature.

Parameters

Name Description Default Range
fast Fast EMA period 12 5–50
slow Slow EMA period 26 10–100
signal_period Signal line period 9 3–30

Historical context

3,243,150 triggers on 24,078 tickers, 1988-04-19 → 2026-05-01. Universe: US large-cap (mcap ≥ $100,000,000, price ≥ $1). Long-only convention: BUY at open T+1, hold the horizon, compare to S&P 500 Equal Weight over the same window.

Methodology footnotes

Benchmarks shown in the detail tables: spxew (S&P 500 Equal Weight — primary, median-stock view, avoids the 2020+ megacap-concentration distortion), spx (S&P 500 cap-weighted, distorted post-2020), msci (MSCI World USD). Per-stock regime tags: trending = ADX(14) ≥ 25, high vol = 20d realized annualized vol ≥ 20%. 1d return = intraday T+1 open→close; 20d = open T+1 to close T+20.

At a glance — alpha vs S&P 500 Equal Weight, US-only

Holding-period sensitivity. Bullish columns: positive = signal worked (long the trigger beat the index). Bearish columns: negative = signal worked (the flagged stock underperformed).

Horizon Bullish α Bearish α
5-day -0.10% +0.01%
20-day +0.04% +0.01%
60-day +0.38% +0.34%
1-year +2.20% +2.21%

Sign flip across horizons. Bullish triggers go from -0.10% (5d) to +2.20% (1y) — short-term fade but longer holding recovers and wins.

Random-date null check (20-day): Bullish: inside null (p=0.945).
Bearish: beats random (p=0.005).

Where does MACD actually fire?

The bucket distribution often reveals what the signal really is, regardless of its textbook label. Heavy concentration in "non-trending + high vol" = it's mostly a chop-market event. Heavy in "trending + low vol" = it picks up the smooth grinds. Read the chart before the alpha numbers — context shapes everything that follows.

MACD Crossover (macd) — trigger count distribution by per-stock regime quadrant (trending/non-trending × high/low realized volatility) for , US-only universe

Does it work in every regime?

Trigger alpha split by the host stock's own regime on the trigger date — trending or ranging, high-vol or low-vol. The 20d alpha you'd actually capture if you took the trade. Bars matching your direction's "right" sign (green) = the signal worked in that regime; opposite sign = avoid it there. A signal with one strong-positive bar and three flat ones isn't a "20d alpha" signal — it's a "20d alpha when the stock is X" signal.

MACD Crossover (macd) — mean 20-day alpha versus S&P 500 Equal Weight by per-stock regime quadrant,  side by side
Trending + Low vol
Stock in a clean directional move with low realized volatility. Textbook "trend-following paradise" — smooth grind with little whipsaw risk.
Trending + High vol
Violent directional moves — parabolic rallies, crisis selloffs. Trend exists but the path is noisy. Signal timing may be imprecise.
Non-trending + Low vol
Quiet chop, summer doldrums, consolidations. No directional bias but also no big swings — small edges become reliable if they exist at all.
Non-trending + High vol
Choppy and violent — the classical "whipsaw zone" for momentum signals. Crossovers and breakouts fire repeatedly without follow-through.

Does it work in every era?

A multi-year average can hide major instability. The sample splits into three windows: 2015–2019 (pre-COVID), 2020–2022 (pandemic + 2022 bear), and 2023+ (post-ZIRP + AI megacap rally). All three matching your direction's "right" sign = the signal is durable. One era doing all the work = a regime-specific edge that may not repeat. The bigger the variance across eras, the smaller the position you should run.

MACD Crossover (macd) — 20-day alpha split by historical sub-period (2015-2019, 2020-2022, 2023+) to check consistency across market regimes

↑ Bullish triggers

Bench Metric 1d 5d 20d 60d 252d
spx Stock % +-0.00% +0.19% +0.98% +2.91% +12.34%
Bench % +0.03% +0.31% +1.18% +3.17% +13.86%
Alpha % -0.03% -0.12% -0.16% -0.27% -1.59%
Median alpha -0.11% -0.42% -1.10% -2.57% -10.21%
Hit rate (α>0) 46.9% 45.5% 44.5% 42.9% 37.9%
p (naive) <0.001 <0.001 <0.001 <0.001 <0.001
p (HAC) <0.001 <0.001 <0.001 <0.001 <0.001
N 1,571,311 1,521,874 1,512,718 1,476,353 1,317,668
msci Stock % +-0.00% +0.19% +0.98% +2.91% +12.34%
Bench % +0.07% +0.31% +1.03% +2.75% +11.40%
Alpha % -0.07% -0.12% -0.01% +0.16% +0.70%
Median alpha -0.15% -0.43% -0.96% -2.16% -7.87%
Hit rate (α>0) 46.0% 45.4% 45.2% 43.9% 40.4%
p (naive) <0.001 <0.001 0.4358 <0.001 <0.001
p (HAC) <0.001 <0.001 0.4989 <0.001 <0.001
N 1,564,570 1,514,869 1,500,340 1,465,824 1,302,252
spxew Stock % +-0.00% +0.19% +0.98% +2.91% +12.34%
Bench % +0.05% +0.28% +0.99% +2.52% +10.15%
Alpha % -0.06% -0.10% +0.04% +0.38% +2.20%
Median alpha -0.13% -0.38% -0.86% -1.86% -6.29%
Hit rate (α>0) 46.7% 46.0% 45.7% 44.7% 42.1%
p (naive) <0.001 <0.001 <0.001 <0.001 <0.001
p (HAC) <0.001 <0.001 0.0002 <0.001 <0.001
N 1,561,702 1,506,578 1,491,077 1,458,261 1,296,775
Distribution of all 20d alpha outcomes for this direction. Median and winsorized mean shown.
MACD Crossover (macd) — bullish 20-day alpha histogram showing distribution of per-trigger returns
Observed 20d alpha (vertical line) against the null distribution of random-date firing. If the line is deep inside the null cloud, the signal adds no information. If it sits in a tail, the signal is doing real work in that direction.
MACD Crossover (macd) — bullish 20-day observed alpha versus random-date permutation null (200 iterations)
Permutation null detail — all horizons × both benchmarks
200-iteration null: for each ticker, sample N random dates from its history (matching observed trigger count) and compute the same alpha. Both observed and null are baseline-centered per ticker (each ticker's own baseline alpha is subtracted), so the null distribution is centered on ~0 and the comparison tests signal effect alone — not the universe-selection lift that all surviving large-caps share. pperm = one-sided fraction of null iters with mean in the "signal was right" tail (right for bullish, left for bearish).
Horizon Bench Observed lift Null mean Null 95% CI pperm
1d spx +0.09% +0.09% [+0.08%, +0.09%] 0.269
1d msci +0.08% +0.09% [+0.09%, +0.09%] 1.000
1d spxew +0.07% +0.08% [+0.07%, +0.08%] 0.861
5d spx +0.30% +0.36% [+0.35%, +0.37%] 1.000
5d msci +0.30% +0.36% [+0.35%, +0.37%] 1.000
5d spxew +0.28% +0.34% [+0.33%, +0.35%] 1.000
20d spx +1.13% +1.14% [+1.12%, +1.15%] 0.836
20d msci +1.16% +1.15% [+1.13%, +1.17%] 0.080
20d spxew +1.09% +1.11% [+1.09%, +1.12%] 0.945
60d spx +2.54% +2.45% [+2.42%, +2.48%] 0.005
60d msci +2.55% +2.47% [+2.44%, +2.50%] 0.005
60d spxew +2.44% +2.38% [+2.35%, +2.41%] 0.005
252d spx +5.01% +4.95% [+4.89%, +5.01%] 0.030
252d msci +5.00% +4.90% [+4.85%, +4.96%] 0.005
252d spxew +4.73% +4.60% [+4.54%, +4.66%] 0.005

Example triggers on US large-caps (2023+, mcap ≥ $30B)

Six recent bullish MACD triggers on US mega-caps. Top three: the signal's best outcomes. Bottom three: the worst. Catalyst-driven outliers (|α| > 25%) excluded so what's left is the signal's own typical good and bad days, not earnings shocks.

Strongest outcomes (what MACD looks like when it works)
Weakest outcomes (what MACD looks like when it fails)
Stock-regime quadrants (2×2 per-stock, 20d alpha detail table)
Each quadrant groups triggers by the stock's own ADX(14) and RV(20) at the trigger date — the textbook conditioning variable (not market-level). Stock %, bench %, alpha %, and HAC p-value shown for each benchmark.
Quadrant N Stock % (spx) Bench % (spx) Alpha % (spx) p (HAC) Stock % (msci) Bench % (msci) Alpha % (msci) p (HAC) Stock % (spxew) Bench % (spxew) Alpha % (spxew) p (HAC)
Trending + Low vol Clean directional grind, low whipsaw 101,975 +0.43% +0.92% -0.45% <0.001 +0.43% +0.77% -0.29% <0.001 +0.43% +0.64% -0.15% <0.001
Trending + High vol Crisis selloff or parabolic rally 510,937 +1.27% +1.39% -0.08% <0.001 +1.27% +1.19% +0.10% <0.001 +1.27% +1.21% +0.12% <0.001
Non-trending + Low vol Quiet chop, summer doldrums 207,810 +0.52% +0.87% -0.34% <0.001 +0.52% +0.73% -0.19% <0.001 +0.52% +0.61% -0.07% <0.001
Non-trending + High vol Classical "whipsaw zone" for momentum 802,556 +1.02% +1.16% -0.10% <0.001 +1.02% +1.02% +0.03% 0.0802 +1.02% +0.99% +0.06% 0.0002
Sub-period breakdown table (20d alpha)
Historical clustering check. If alpha concentrates in one era, the signal's robustness is questionable.
Period N Alpha % (spx) p (HAC) Alpha % (msci) p (HAC) Alpha % (spxew) p (HAC)
2015-2019 2015-01-01 → 2020-01-01 489,732 -0.45% <0.001 -0.27% <0.001 -0.27% <0.001
2020-2022 2020-01-01 → 2023-01-01 477,836 +0.26% <0.001 +0.43% <0.001 -0.08% 0.0003
2023-2026 2023-01-01 → 2099-01-01 655,143 -0.25% <0.001 -0.13% <0.001 +0.37% <0.001

↓ Bearish triggers negative alpha = signal was right (stock underperformed market)

Bench Metric 1d 5d 20d 60d 252d
spx Stock % -0.02% +0.17% +0.74% +2.74% +12.02%
Bench % +0.00% +0.18% +0.98% +3.14% +13.67%
Alpha % -0.02% -0.02% -0.20% -0.38% -1.75%
Median alpha -0.05% -0.25% -1.07% -2.57% -10.22%
Hit rate (α>0) 48.6% 47.2% 44.6% 42.8% 37.8%
p (naive) <0.001 <0.001 <0.001 <0.001 <0.001
p (HAC) <0.001 <0.001 <0.001 <0.001 <0.001
N 1,570,637 1,515,379 1,508,282 1,474,405 1,315,044
msci Stock % -0.02% +0.17% +0.74% +2.74% +12.02%
Bench % +0.03% +0.18% +0.87% +2.75% +11.31%
Alpha % -0.04% -0.01% -0.09% +0.06% +0.55%
Median alpha -0.07% -0.25% -0.95% -2.15% -7.92%
Hit rate (α>0) 48.0% 47.3% 45.1% 43.9% 40.3%
p (naive) <0.001 0.2364 <0.001 0.0008 <0.001
p (HAC) <0.001 0.2463 <0.001 0.0437 0.0003
N 1,561,935 1,508,905 1,501,606 1,465,933 1,309,100
spxew Stock % -0.02% +0.17% +0.74% +2.74% +12.02%
Bench % +0.02% +0.16% +0.79% +2.46% +9.86%
Alpha % -0.05% +0.01% +0.01% +0.34% +2.21%
Median alpha -0.07% -0.21% -0.81% -1.79% -6.23%
Hit rate (α>0) 48.3% 47.7% 45.9% 44.9% 42.1%
p (naive) <0.001 0.0103 0.4075 <0.001 <0.001
p (HAC) <0.001 0.0121 0.4811 <0.001 <0.001
N 1,555,328 1,499,445 1,491,245 1,455,890 1,300,554
Distribution of all 20d alpha outcomes for this direction. Median and winsorized mean shown.
MACD Crossover (macd) — bearish 20-day alpha histogram showing distribution of per-trigger returns
Observed 20d alpha (vertical line) against the null distribution of random-date firing. If the line is deep inside the null cloud, the signal adds no information. If it sits in a tail, the signal is doing real work in that direction.
MACD Crossover (macd) — bearish 20-day observed alpha versus random-date permutation null (200 iterations)
Permutation null detail — all horizons × both benchmarks
200-iteration null: for each ticker, sample N random dates from its history (matching observed trigger count) and compute the same alpha. Both observed and null are baseline-centered per ticker (each ticker's own baseline alpha is subtracted), so the null distribution is centered on ~0 and the comparison tests signal effect alone — not the universe-selection lift that all surviving large-caps share. pperm = one-sided fraction of null iters with mean in the "signal was right" tail (right for bullish, left for bearish).
Horizon Bench Observed lift Null mean Null 95% CI pperm
1d spx +0.09% +0.09% [+0.08%, +0.09%] 0.985
1d msci +0.10% +0.09% [+0.08%, +0.09%] 1.000
1d spxew +0.08% +0.08% [+0.07%, +0.08%] 1.000
5d spx +0.38% +0.36% [+0.35%, +0.37%] 1.000
5d msci +0.39% +0.36% [+0.35%, +0.37%] 1.000
5d spxew +0.37% +0.34% [+0.33%, +0.35%] 1.000
20d spx +1.07% +1.14% [+1.12%, +1.16%] 0.005
20d msci +1.06% +1.15% [+1.13%, +1.17%] 0.005
20d spxew +1.04% +1.11% [+1.09%, +1.13%] 0.005
60d spx +2.43% +2.45% [+2.41%, +2.48%] 0.124
60d msci +2.45% +2.47% [+2.43%, +2.50%] 0.129
60d spxew +2.41% +2.38% [+2.35%, +2.41%] 0.975
252d spx +4.92% +4.95% [+4.89%, +5.02%] 0.164
252d msci +4.90% +4.90% [+4.84%, +4.97%] 0.428
252d spxew +4.76% +4.60% [+4.54%, +4.67%] 1.000

Example triggers on US large-caps (2023+, mcap ≥ $30B)

Six recent bearish MACD triggers on US mega-caps. Top three: the signal's best outcomes. Bottom three: the worst. Catalyst-driven outliers (|α| > 25%) excluded so what's left is the signal's own typical good and bad days, not earnings shocks.

Strongest outcomes (what MACD looks like when it works)
Weakest outcomes (what MACD looks like when it fails)
Stock-regime quadrants (2×2 per-stock, 20d alpha detail table)
Each quadrant groups triggers by the stock's own ADX(14) and RV(20) at the trigger date — the textbook conditioning variable (not market-level). Stock %, bench %, alpha %, and HAC p-value shown for each benchmark.
Quadrant N Stock % (spx) Bench % (spx) Alpha % (spx) p (HAC) Stock % (msci) Bench % (msci) Alpha % (msci) p (HAC) Stock % (spxew) Bench % (spxew) Alpha % (spxew) p (HAC)
Trending + Low vol Clean directional grind, low whipsaw 112,897 +0.28% +0.81% -0.52% <0.001 +0.28% +0.67% -0.36% <0.001 +0.28% +0.51% -0.18% <0.001
Trending + High vol Crisis selloff or parabolic rally 562,962 +1.10% +1.00% +0.14% <0.001 +1.10% +0.88% +0.27% <0.001 +1.10% +0.77% +0.40% <0.001
Non-trending + Low vol Quiet chop, summer doldrums 205,330 +0.19% +0.90% -0.68% <0.001 +0.19% +0.77% -0.54% <0.001 +0.19% +0.67% -0.43% <0.001
Non-trending + High vol Classical "whipsaw zone" for momentum 738,674 +0.72% +1.02% -0.25% <0.001 +0.72% +0.93% -0.17% <0.001 +0.72% +0.88% -0.11% <0.001
Sub-period breakdown table (20d alpha)
Historical clustering check. If alpha concentrates in one era, the signal's robustness is questionable.
Period N Alpha % (spx) p (HAC) Alpha % (msci) p (HAC) Alpha % (spxew) p (HAC)
2015-2019 2015-01-01 → 2020-01-01 485,684 -0.55% <0.001 -0.38% <0.001 -0.36% <0.001
2020-2022 2020-01-01 → 2023-01-01 482,552 +0.10% <0.001 +0.21% <0.001 -0.14% <0.001
2023-2026 2023-01-01 → 2099-01-01 651,055 -0.16% <0.001 -0.09% <0.001 +0.41% <0.001

Methodology and caveats

How to read. Entry at open of T+1 (one trading day after the signal fires on close of T). 20d = open T+1 to close T+20. Alpha = stock return − benchmark return over the same window (Convention A, single-sided, textbook). For bullish triggers, POSITIVE alpha = signal was right. For bearish triggers, NEGATIVE alpha = signal was right (stock underperformed market). No sign-flipping; the direction of the bet determines what "good" looks like. Per-stock regime is each stock's own ADX(14) and RV(20) at the trigger date — not market-wide state.

Three p-values, three robustness tests. (a) p_naive: scipy one-sample t-test on winsorized alphas. Optimistic because overlapping 20d windows on the same ticker inflate effective N. (b) p_hac: Newey-West HAC with lag = horizon — corrects for the overlap and is the academic-finance standard. (c) p_perm: fraction of 200 random-date null iterations with mean ≥ observed. Tests whether the signal beats random date selection at all. A signal that clears all three (pnaive, phac, pperm all < 0.05) has real information; a signal that fails pperm has zero edge even if the t-test says "significant."

Caveats. (i) Universe reflects today's active tickers; delisted losers pruned → survivorship bias. (ii) Mcap ≥ $100M filter uses today's snapshot, not point-in-time — mild lookahead on which stocks enter the sample, not on returns. (iii) Means and p-values use winsorized alphas (1/99 percentile) to prevent data errors from dominating. Medians and hit rates use raw data. (iv) Zero transaction costs assumed. Realistic bid-ask + commissions remove 20–40bps from 20d alpha on US large-caps, more on small-cap. Sub-20bps alpha is noise in practice. (v) Past performance does not predict future results.

How to use this

1 · When to reach for this signal

Neutral signal. Bullish 20d alpha -0.16%, bearish -0.20%. Neither direction beats random date selection (pperm not significant either way). Observed alpha is likely noise or universe drift rather than information about the trigger. Useful for context, not for standalone entries.

2 · When it works — the setups that drive it

  • Best bullish setup: Trending + High vol — alpha -0.08% / 20d on 510,937 historical triggers.
  • Best bearish setup: Trending + High vol — alpha +0.14% / 20d on 562,962 historical triggers.
  • Best era for bullish: 2020-2022 — alpha +0.26% / 20d.
  • Best era for bearish: 2020-2022 — alpha +0.10% / 20d.

3 · When it fails — common false positives

  • Weakest bullish cell: Trending + Low vol — alpha -0.45% / 20d on 101,975 triggers.
  • Weakest bearish cell: Non-trending + Low vol — alpha -0.68% / 20d on 205,330 triggers.
  • Worst era for bullish: 2015-2019 — alpha -0.45% / 20d.
  • Worst era for bearish: 2015-2019 — alpha -0.55% / 20d.

Signal-specific failure patterns

The laggard trap (bullish)
MACD bullish on a stock already above its 200DMA and trending cleanly. The fast-EMA crossover above the slow EMA fires after a brief pullback — but the market has already moved, and the stock catches up without exceeding the benchmark's move. This is why the textbook-favorable 'trending + low vol' quadrant delivers the weakest bullish alpha.
evidence: trending_low_vol bullish 20d alpha = −0.29%, p(HAC) < 0.001
Capitulation bounce (bearish)
Bearish MACD fires during violent selloffs — crossover registers in the 'non-trending + high vol' quadrant right around oversold bottoms. These prints look bearish but are often followed by sharp mean-reversion bounces that stop out shorts. Consistent with the signal's worst bearish alpha sitting exactly in this regime.
evidence: nontrend_high_vol bearish 20d alpha ≈ 0%, fails the HAC test
Earnings-week contamination
MACD crossovers that fire on news-driven gap days don't behave like momentum — they're reacting to information, not technical structure. Our backtest does not exclude earnings weeks, so some of the observed alpha (or lack of it) is contaminated by event-driven moves. Screen should filter out triggers within ±3 trading days of scheduled earnings.
evidence: not directly tested; known methodology gap
2023+ bullish degradation
MACD bullish alpha has turned decisively negative in the post-ZIRP AI-megacap rally era (2023+). The signal appears to have become particularly miscalibrated when a small number of concentrated leaders drive index returns while broader market participation is uneven.
evidence: 2023+ bullish 20d alpha = −0.27%, p(HAC) < 0.001

4 · Pairing inside a screen

The statements below describe how this signal relates to others by construction — which indicator family it belongs to, and where same-family redundancy might reduce the independence of evidence inside a Daily Report. These are taxonomic classifications drawn from standard technical-analysis texts; they are not pairing backtests. A multi-signal convergence backtest is planned but not yet run.

Trend-following momentum construction

MACD is the difference between two exponential moving averages of closing price (Appel, Technical Analysis: Power Tools for Active Investors, 2005) and is classified as a trend-following momentum indicator (Murphy, Technical Analysis of the Financial Markets, 1999; Kirkpatrick & Dahlquist, Technical Analysis, 3rd ed. 2015). Its construction overlaps with moving-average crossover signals, which also derive from differences of moving averages of price; stacking MACD with MA crossover in the same direction produces correlated rather than independent evidence.

What would likely rescue this signal

This block calls out the data or conditions that could turn a technically weak signal into a usable one in a composite screen. Based on signal mechanics and the observed failure patterns above; individual combinations are not yet backtested.

  • Use MACD bearish as a screening filter, not a standalone triggerBearish MACD has real left-tail permutation significance (p<0.005 against SPXEW at 20d and 60d), but the point-estimate alpha is small (~15-40 bps/month). That's not tradable net of costs on its own. Useful as one member of a bearish screen stack — require bearish MACD AND another independent bearish read (close below 50DMA, fresh 52w low, sector breadth < 30%). The conjunction concentrates the edge; any single trigger is too noisy.
  • Regime-gate bullish side — it worked pre-QEMACD bullish has shown positive alpha in specific sub-periods (pre-2020 low-rate low-megacap-concentration era). A regime gate — 'only take bullish MACD when market breadth > 60% and SPX not within 5% of ATH' — might restore part of that historical edge while cutting the signal-set by ~70%. Testable with the existing breadth engine; not yet wired to the screen filter layer.
  • Pair with volume confirmationMACD fires on a mathematical EMA relationship that ignores volume. A bullish crossover on heavy volume (2× 20d average) is a different population than one on thin volume. Volume-confirmation is the single most likely filter to rescue MACD bullish; it's also one we already have data for (daily_prices.volume). Implementing as a composite signal on the screen page would be straightforward.

See also Why technical-only signals don't survive on their own for the broader argument.

5 · Before you act — a 5-point checklist

  1. Normal trading day? Rule out earnings (within ±3 days), ex-dividend, or known corporate-action dates — the signal is almost certainly reading noise, not momentum, in those windows.
  2. Where is price vs its own 50 / 200 DMA? A trend signal is only as credible as the underlying trend it claims to confirm. Check the 200DMA orientation before acting.
  3. What's the sector breadth doing? An isolated signal in a broadly down-trending sector is a lower-confidence setup than one firing with the rest of its peer group.
  4. Is ADV20 enough for your size? If the trigger is on a $500M name and you want to move $1M notional, you're the tape. Consider adv20d ≥ 5% of your intended position.
  5. What invalidates you? Define a price level (for longs: a close below the trigger-day low; for shorts: close above the trigger-day high) and honor it. The backtest alpha is an average; any one trade can be at either tail.

Execution notes

The backtest measures entry at open T+1 (one day after the signal fires on close of T) with exit at close T+20 on the 20-day horizon. Earlier entry (intraday on trigger day) was not tested and our prior is that it's noisier due to late-day fade dynamics on momentum names. 20d offers the best alpha-per-day of the horizons tested; 60d compounds more absolute alpha but is also more exposed to earnings cycles and regime change.