Case study · Backtest
🗓 Backtest period: 2020-01-01..2026-11-01
Spec ID: spec-breadth-aware-quality-momentum-long-short-top500-us-stocks-1781966836_v8 · Generated: 2026-11-05 11:11 UTC
Cluster: Quality Momentum · Sub Cluster: Breadth-Aware Sector-Neutral Long-Short
Buy high-quality stocks with persistent positive risk-adjusted momentum and short weak-quality laggards within sectors. Scale a nominally dollar-neutral portfolio using market breadth, equal-weight market trend, and portfolio drawdown.
The strategy combines slow incorporation of information into prices with persistent differences in profitability, leverage, and cash generation. Quality screening seeks to distinguish durable momentum from financially fragile price strength, while shorting weak-quality laggards expresses the opposite exposure.
Within-sector ranking and dollar neutrality seek to isolate stock-selection effects rather than sector direction. Breadth, trend, and drawdown overlays reduce exposure when participation deteriorates or portfolio losses accumulate; their incremental benefit is a hypothesis, not established by the supplied results.
Specification-level logic; the truncated code does not establish complete implementation fidelity.
[code omitted from public view]
| Param | Value | Notes |
|---|---|---|
| Universe | STOCK; top_n = 500; sort_by = capitalization | Supplied explicit 500-symbol list; historical membership reconstruction is unverified. |
| Planned backtest | 2020-01-01..2026-11-01 | Daily bars; wfa, plan position_limits, and plan liquidity_filter are null. Rule-level limits still apply. |
| Declared data period | 2018-01-01..2023-01-01 | Does not cover the full planned backtest; actual evaluated interval is unresolved. |
| Rebalance / execution | close; daily bars, MOC (market-on-close) | Price signals use prior completed daily bars. |
| Data sources | daily_prices; financial_statements; instruments_full | Sector field: sector. |
| Fundamental timing | fundamental_data_lag_days = 45; earnings_release_lag_days = 2 | Quarterly statements; use TTM when available. |
| Quality method | weighted_within_sector_zscore | Winsorize at [0.01, 0.99]; rank within sector. |
| Quality weights | ROA 0.20; ROE 0.25; debt/assets 0.15; gross profit/assets 0.20; operating cash flow/assets 0.20 | Higher is better except debt/assets. |
| Quality thresholds | high >= 0.70; weak <= 0.30 | Also applied to long/short selection. |
| Momentum method | weighted_within_sector_rank | Return excluding skip period / annualized realized volatility. |
| Momentum windows | 63 days: 0.30; 126 days: 0.35; 252 days: 0.35 | Skip latest 21 trading days; volatility lookback 126 days. |
| Momentum persistence | Long rank >= 0.70 and 3 windows above sector median; short rank <= 0.30 and 2 windows below | Three momentum windows in total. |
| Composite selection | quality_weight = 0.50; risk_adjusted_momentum_weight = 0.50 | Long within-sector composite rank >= 0.90; short <= 0.10. |
| Six-month return filters | Long positive; short negative or bottom half | Additional selection requirements. |
| Candidate minimums | 20 per side overall; 1 per side per sector | Insufficient-candidate handling requires verification. |
| Breadth method | enabled; weighted_zscore_average; zscore_lookback_days = 252 | Same top-500 universe; sector breadth scores enabled, downstream use not shown. |
| Breadth feature weights | Above 50d SMA: 0.20; above 200d SMA: 0.25; positive 126d return: 0.20; 20d advance/decline ratio: 0.15; median 126d momentum: 0.10; 63d highs minus lows: 0.10 | Feature lookbacks: 50, 200, 126, 20, 126, and 63 trading days, respectively. |
| Breadth multiplier 1.00 | breadth_zscore >= 0.25 and percentage_above_200d_sma >= 0.55 and median_stock_6m_momentum > 0 | Configured condition. |
| Breadth multiplier 0.75 | breadth_zscore >= -0.50 and percentage_above_200d_sma >= 0.45 | Conditions overlap; precedence is not shown. |
| Breadth multiplier 0.50 | breadth_zscore >= -1.00 and percentage_above_200d_sma >= 0.35 | Conditions overlap; precedence is not shown. |
| Breadth multiplier 0.25 | breadth_zscore < -1.00 or percentage_above_200d_sma < 0.35 or median_stock_6m_momentum < -0.10 | Severe negative median momentum can overlap other conditions. |
| Market trend overlay | equal_weight_top500_close_index; fast SMA 50; slow SMA 200; deterioration multiplier 0.70 | Reduce when fast < slow and when index < 200d SMA; simultaneous-trigger treatment is unverified. |
| Drawdown control | enabled; rolling peak 252 days; trigger 8% -> 0.60; severe 12% -> 0.35; restore below 4% | Uses backtest runner portfolio equity. |
| Exposure targets | base long 1.0; base short 1.0; base gross 2.0; target net 0.0; max absolute net 0.05 | final_gross_exposure_formula = base_gross_exposure * breadth_multiplier * market_trend_multiplier * drawdown_multiplier. |
| Maximum leverage | 4.0 | Separate ceiling above the nominal 2.0 base gross. |
| Sector neutrality | enabled; net sector target 0.0; max sector net 0.02; max sector weight deviation 0.05 | Sector gross proportional to available candidates; rebalance within-sector long/short dollar neutral. |
| Position sizing | sector_neutral_equal_weight_within_side; min 0.001; max 0.10 | Separate single-name risk cap also 0.10. |
| Volatility sizing | enabled; lookback 63 days; adjustment floor 0.50; cap 2.0 | Target position-volatility equalization. |
| Trading risk limits | stop_loss_pct = 0.20; take_profit_pct = null; max_daily_turnover_pct = 0.50 | Stop fill mechanics and turnover-limit priority are not shown. |
| Liquidity | min_volume_in_dollars_20d = 10000000 | Rule-level 20-day dollar-volume filter. |
| Price safeguards | no_synthetic_execution_prices = true; skip_trade_if_missing_execution_price = true | Actual enforcement requires full-code verification. |
| Commissions | NOT APPLIED — metrics are gross of costs | the post-backtest cost recalculation failed for this run (mark-to-market: PriceReadFailed: daily mark read failed for 40 symbols: (psycopg2.errors.QueryCanceled) canceling statement due to statement timeout |
[SQL: SELECT datetime, symbol_key, close, factor FROM daily_prices WHERE symbol_key = ANY(%(symbols)s) ); the model that would have been charged is $0.0040 per share (contract for futures and options), minimum $1.00 per order, capped at 1.00% of trade value | | Slippage | not applied | Not applied — the cost recalculation did not run |
| # | Concern | Status |
|---|---|---|
| 1 | Price signals and execution timing | Configured: prior completed daily bars, execution at the close via MOC. Verify all derived breadth, volatility, and trend panels obey the same timestamp convention; same-day close-derived signals must not execute at that day's open. |
| 2 | Fundamental publication availability | Configured: 45-day fundamental lag and 2-day earnings-release lag. Verify actual publication timestamps, T+1 minimum when release timing is unknown, and point-in-time values without later restatements. |
| 3 | Universe and sector history | Unverified: explicit symbol list and metadata source do not establish historical capitalization membership, delisting coverage, or point-in-time sector classifications. |
| 4 | Rolling transformations and equity feedback | Verify trailing-only breadth z-scores, return/volatility windows, and drawdown equity observations; no full-sample normalization or future equity inputs. |
| 5 | Data coverage and reported accounting | Unresolved: declared data end precedes planned end; zero-valued performance fields coexist with 107,029 trades and failed mark-to-market cost recalculation. |
[SQL:
SELECT datetime, symbol_key, close, factor
FROM daily_prices
WHERE symbol_key = ANY(%(symbols)s)
), so no commission was subtracted from any fill. They are not comparable to a strategy whose costs were applied.
- The reported metrics are preliminary and GROSS of commissions and every other cost; cost recalculation fails. costs_applied.not_charged_reason: "the post-backtest cost recalculation failed for this run (mark-to-market: PriceReadFailed: daily mark read failed for 40 symbols: (psycopg2.errors.QueryCanceled) canceling statement due to statement timeout\n\n[SQL: \n SELECT datetime, symbol_key, close, factor\n FROM daily_prices\n WHERE symbol_key = ANY(%(symbols)s)\n )". These figures are not comparable to cost-applied cards.
- Total return, Sharpe, maximum drawdown, and volatility are all reported as zero despite 107,029 trades. These fields do not establish a flat, riskless, or successful strategy; the performance record remains unvalidated.
- The declared data period ends on 2023-01-01, while the planned test extends through 2026-11-01. The supplied artifacts do not establish the actual evaluated interval or coverage.
- The explicit universe and sector metadata do not establish point-in-time selection. Survivorship, issuer/share-class duplication, instrument classification, and historical sector membership remain material data risks.
- The code excerpt is truncated. Breadth-condition precedence, simultaneous trend reductions, insufficient-candidate handling, sector-breadth use, and stop execution mechanics are not verified against the specification.
- Tight joint quality/momentum filters can leave sparse sector candidate pools. Volatility scaling, turnover limits, missing execution prices, and stops can prevent intended neutrality or exposure targets; dollar neutrality does not ensure beta neutrality.
- Short borrow fees / rebate, margin financing on leverage, market impact, exchange/regulatory/clearing pass-through fees, and taxes are excluded. Borrow availability and short squeezes are additional risks for this leveraged long-short book.
- No walk-forward analysis is specified. Numerous thresholds and interacting exposure overlays leave parameter sensitivity and out-of-sample robustness unresolved.
The run reports 107,029 trades across 500 symbols, but total return, Sharpe, maximum drawdown, and volatility are all zero in the supplied raw metrics. This combination, the failed mark-to-market cost recalculation, and the unresolved date coverage prevent a credible assessment of profitability or risk. All reported figures are preliminary and gross of commissions and other costs; they do not demonstrate that quality selection, sector neutrality, or the exposure overlays add value.
| Metric | Value |
|---|---|
| Total Trades | 107029 |
| Symbols | 500 (A, AAPL, ABBV, ABNB, ABT, ACGL, ACN, ACON, ADBE, ADI, +490 more) |