Trading strategy

Rank large-cap stocks by trailing 12-1 momentum, remove sector tilts, hold the top decile equal-weight, and rebalance monthly net of turnover costs.

Signal12-month momentum, skipping the most recent month.
NeutralizationProject out sector dummy exposure, then re-rank stocks.
PortfolioLong-only, equal-weight top decile, monthly rebalance.
Costs5 bps per unit of one-way turnover, including initial buy.

Alpha and t-stat

Alpha is the regression intercept: the average return left after subtracting exposure to benchmark factors. The t-statistic is alpha divided by its standard error; larger absolute values mean the estimate is less likely to be noise.

The four Fama-French factors used here are MKT (market excess return), SMB (Small Minus Big size factor), HML (High Minus Low value factor), and MOM (winner-minus-loser momentum factor).

Generate a new alpha

Draw an alternate market path from the factor model, re-run the momentum backtest, and see whether the generated alpha lands near the real one. A "Share ≥ real" near 50% is the ideal — it means the real alpha is typical, not a lucky outlier.

Why is the baseline alpha here (~4.5%) lower than the headline 5.97% above? The stress test uses a simplified pipeline — raw 12-1 momentum with no sector neutralization and no transaction costs, run on the balanced PCA panel (~394 stocks) instead of the full universe. This keeps each bootstrap path fast enough to compute. The stress test answers the same question either way: is the alpha a lucky path? (No.)

Synthetic-market alpha distribution

Generated path — long-only equity curve

Performance — how did the portfolio do?

A top-decile long-only momentum portfolio, rebalanced monthly net of 5 bps per unit of one-way turnover. Benchmarked against the equal-weight universe.

Equity curves (net of cost)

Long-only top decile vs the equal-weight universe (the fair benchmark) and the long-short book.

Long-only drawdown

Peak-to-trough drop of the compounded wealth curve.

Factor diagnostics — which signals predict next-month returns?

Information coefficient (IC) = Spearman rank correlation between the factor vector and next-month returns — the cosine of the angle between the rank vectors. Momentum is the only factor with positive IC.

Mean information coefficient by factor

Bars = mean monthly IC; momentum is the only positive-IC factor.

Cross-factor rank correlation (Gram matrix)

Momentum vs quality ≈ 0.86 — nearly collinear, redundant information.

Walk-forward IC (5-year windows)

Momentum IC by subperiod — regime-dependent; the 2006–11 window includes the 2008–09 crash.

Risk decomposition — where does the portfolio's variance live?

Eigendecompose the covariance Σ = VΛVT. Marchenko–Pastur (random matrix theory) separates signal eigenvalues from noise. Portfolio variance wTΣw splits into the top-k factor subspace (systematic) and its orthogonal complement (idiosyncratic).

Eigenvalue scree + Marchenko–Pastur cutoff

Eigenvalues above λ+ (dashed) are statistically significant factors; the rest is noise.

Systematic vs idiosyncratic risk

Variance in the top-k eigenspace vs its orthogonal complement.

Ticker explorer — stocks in factor space

Each stock's loadings on PC1 (≈ the market factor) and PC2 (≈ value), colored by sector. Marker size = latest momentum score. Pick a ticker for its details.

PC1 vs PC2 loadings, colored by sector

Select a ticker to see its momentum score, sector, and factor loadings.

Notebook process — what this project did

The app is a compact view of the notebook pipeline: build the return matrix, test factors, construct the signal, backtest it, decompose risk, then stress-test the alpha with synthetic markets.

01

Build the return matrix

Use cached S&P 500 constituent and adjusted-price data to assemble monthly returns, sectors, breadth, dispersion, and an equal-weight baseline.

02

Diagnose factors

Compute price-based momentum, value, quality, and low-volatility proxies; measure IC, decay, stability, turnover proxy, and cross-factor correlation.

03

Construct the signal

Winsorize, z-score, sector-neutralize, and compare momentum-only against a four-factor composite. Momentum-only is the cleaner signal.

04

Backtest and challenge it

Trade the top decile long-only, subtract turnover costs, run Fama-French alpha, HAC t-stats, beta checks, survivorship drag, and robustness grids.

05

Decompose risk

Estimate covariance, run PCA, use Marchenko-Pastur to choose signal factors, and split portfolio variance into systematic and idiosyncratic pieces.

06

Synthesize markets

Write R ≈ F BT + E, block-bootstrap matched rows of F and E, rebuild R, and rerun the strategy on alternate histories.

Synthetic panel construction

The return matrix R is decomposed into factor scores F, stock loadings B, and residuals E. A synthetic path resamples matched rows of F and E in short blocks, then reconstructs Rsynth = FbootBT + Eboot + mean(r). Matching the rows matters because it keeps market-wide shocks and stock-specific shocks internally consistent.

Heuristic picture

Think of historical months as index cards. Instead of shuffling single cards, the bootstrap shuffles small packets of neighboring cards, so short regimes like selloffs, rebounds, and momentum bursts mostly stay intact. Each shuffled deck is an alternate market history; the app reruns the same strategy and records the alpha.