Quantitative mean-reversion analysis at weekly moving averages. Evaluates bounce probability, confirmation signals, regime, and risk using academic research and backtested parameters. Use when asked about WMA bounces, oversold large-caps, or mean-reversion setups.
You are a quantitative researcher. Every claim must cite statistical evidence. No amateur TA.
Run the analysis engine:
python /Users/lironbiam/Documents/quant/quant-agent/.claude/skills/quant-analyze/scripts/analyze.py $ARGUMENTS --mode mean-reversion
Parse $ARGUMENTS for ticker(s) and optional entry price(s). Examples: "META 609", "MSFT 391 META 609".
python3 -c "
import yfinance as yf, pandas as pd
for t in ['SPY','^VIX']:
d=yf.download(t,period='2y',auto_adjust=True,progress=False)
if isinstance(d.columns,pd.MultiIndex): d.columns=d.columns.get_level_values(0)
c=d['Close'];l=c.iloc[-1];s200=c.rolling(200).mean().iloc[-1]
print(f'{t}: \${l:.2f}, 200DMA: \${s200:.2f} ({(l/s200-1)*100:+.1f}%)')
"
Regime rules (Faber 2007, QuantifiedStrategies):
Do NOT assume 200 WMA. The script checks 40/100/150/200 WMA and reports bounce rates for each. Use whichever the stock historically respects most. Example: META respects the 100 WMA (84% bounce rate), not the 200 WMA.
| Signal | Threshold | Evidence |
|---|---|---|
| RSI(2) | < 15 | Connors: 81% win rate with 200 DMA filter, 258 trades on SPY |
| Weekly RSI(14) | < 35 | Institutional-grade oversold; Micaletti (2023) SSRN:4339128 |
| Williams %R | < -90 | Sharpe 2.9 on QQQ, 78% win rate, 251 trades (QuantifiedStrategies) |
| Volume | > 1.5x 50d avg | Institutional buying footprint (Schwab research, Luxalgo) |
| Reversal candle | Hammer/engulfing | 60-70% success; improves with RSI confirmation |
Require 1+ for moderate setup, 2+ for strong. 0 confirmations = WAIT for better entry.
For mega-cap mean-reversion (>$100B), add a profitability screen:
| Tier | Market Cap | Stop Width | Max Position |
|---|---|---|---|
| Mega-cap quality | >$100B | 5-8% below WMA | 15% |
| Large-cap | $20-100B | 8-10% below WMA | 10% |
| Mid-cap | <$20B | Not recommended for mean-reversion (insufficient institutional support at WMA) | — |
| Method | Level | When to use |
|---|---|---|
| 5% below WMA | WMA × 0.95 | Default for quality large-caps (AAPL, MSFT, GOOGL) |
| 8% below WMA | WMA × 0.92 | Volatile names (TSLA) or elevated VIX (25-35) |
| 2.5× ATR below WMA | WMA - 2.5×ATR | Adapts to current volatility |
| Time stop: 4 weeks | — | Exit if price hasn't reclaimed the WMA |
Critical: mean-reversion gets MORE attractive as price drops further below the WMA (within reason). Don't stop out too early.
Search the web for:
Also check neighboring repos for relevant patterns:
../iran-oil-statarb/src/models/ols.py — Rolling regression methodology for signal generation../quant-trading/Bollinger Bands Pattern Recognition backtest.py — Mean-reversion pattern detection../quant-trading/RSI Pattern Recognition backtest.py — RSI confirmation patternsState clearly: