Skip to content

Latest commit

 

History

History
160 lines (126 loc) · 8.99 KB

File metadata and controls

160 lines (126 loc) · 8.99 KB

Final evidence-backed system proposal

Status date: 2026-07-16

Executive decision

The project should be presented as a modular, leakage-aware portfolio research and backtesting platform, not as a validated market-beating product.

The experiments produced a credible research workflow, realistic execution accounting, and several useful directional findings. They did not produce enough independent statistical evidence to activate ML alpha, sentiment, tactical news, topic, or pair-trading claims in a live portfolio. The final architecture therefore retains those modules as controlled research adapters while setting every unconfirmed incremental sleeve to zero by default.

This is a stronger final project than the original ten-stock optimizer because it distinguishes software capability, development evidence, and confirmed investment value.

What the project became

The original system used ten hindsight-surviving stocks, one-day forecasts, weekly rebalancing, and backtest accounting that overstated performance. The revised platform now provides:

  • effective-dated S&P 500 membership and lagged liquidity selection;
  • incremental yfinance caching and resumable historical text imports;
  • a five-session sector-neutral residual-return rank target aligned with weekly decisions;
  • purged walk-forward model selection and persisted out-of-sample forecasts;
  • a frozen 40-name hold zone with explicit sector, turnover, and cash rules;
  • next-open execution with fixed fees, spread/slippage, borrow assumptions, and liquidation;
  • exposure-matched benchmarks, shuffled placebos, block bootstraps, and untouched-period rules;
  • cached official Fama-French factors, historical-only beta estimates, and factor attribution;
  • FinBERT, slow sentiment, point-in-time NMF topics, exact-time event, and pair adapters;
  • dated manifests and experiment logs for every material conclusion.

Evidence and module decisions

Component Strongest result Evidence verdict Final default
Data and caching Incremental market cache; point-in-time universe; 95.8% public-confirmation price coverage Useful infrastructure Retain
Backtest and costs Fill timing and double-cost defects corrected; costs attributed separately Technically validated Retain
Prediction target Five-session sector-neutral residual-return rank Correctly aligned with weekly horizon Retain
FF3 target and attribution FF3 target CAGR 8.06% versus 5.34% control Incremental CI crosses zero; shuffle p=0.366; alpha p=0.768 Retain attribution; target off
Legacy LSTM/Transformer Sequence code can cross ticker boundaries Existing outputs are not valid panel forecasts Excluded; no reconstruction in current scope
Frozen numeric core 11.34% CAGR versus 11.05% for 70% SPY/30% cash in shortened confirmation Shuffle p=0.198 and 95% active interval crosses zero Research baseline only
Slow sentiment + topics +1.71% annualized versus fixed numeric forecast 95% interval crosses zero; timestamp-shuffle p=0.366; 12.71% coverage Contribution weight 0
Point-in-time NMF Median alignment 0.905 and diversity 0.91 Eligible-row coverage 13.95%, below frozen 50% gate Research features only
Exact-time FinBERT events Five-session matched increment -44.62 bps Timing p=0.978 and sign p=0.949 Tactical trading disabled
Pair trading +0.038% annualized; timing-shift p=0.0099 Confidence bound crosses zero; random-pair p=0.218 Sleeve weight 0
LLM event extraction Structured schema proposed Not implemented or tested No portfolio authority

The project can report the measured portfolio values as historical experimental outcomes. It must not describe any failed gate as confirmed alpha or imply that an observed development result will persist.

Final reference architecture

flowchart TD
    SOURCES["Market, membership, macro, factor, and text sources"] --> CACHE["Incremental immutable caches"]
    CACHE --> PIT["Point-in-time eligibility and availability audit"]
    PIT --> FEATURES["Lagged numeric and text feature store"]
    FEATURES --> TARGET["Five-session sector-neutral residual-return rank"]
    CACHE --> FF3["Historical-only FF3 betas and attribution"]
    FF3 -. "experimental target failed gates" .-> TARGET

    TARGET --> CORE["Frozen numeric research core<br/>40-name hold zone, 70% invested"]
    FEATURES --> SLOW["Slow sentiment and NMF topics<br/>research adapter"]
    FEATURES --> EVENT["Exact-time FinBERT events<br/>research adapter"]
    CACHE --> PAIRS["Point-in-time pair research<br/>cointegration and spread state"]

    SLOW --> SLOWGATE{"Coverage + bootstrap + shuffle gates"}
    EVENT --> EVENTGATE{"Timing + sign + cost gates"}
    PAIRS --> PAIRGATE{"Confidence + random-pair gates"}

    SLOWGATE -->|"failed: weight 0"| DISABLED["Inactive incremental sleeves"]
    EVENTGATE -->|"failed: weight 0"| DISABLED
    PAIRGATE -->|"failed: weight 0"| DISABLED

    CORE --> EXEC["Next-open execution and cost model"]
    DISABLED -. "available for future frozen experiments" .-> EXEC
    EXEC --> EVAL["SPY/cash benchmark, placebos, bootstrap, regime and cost attribution"]
    EVAL --> REPORT["Versioned reports, manifests, and experiment logs"]
Loading

Frozen research-reference portfolio

The repository's reference strategy remains the interpretable v4 contract:

Item Frozen value
Candidate universe Point-in-time liquid S&P 500 members
Forecast target Five-session sector-neutral residual-return rank
FF3 policy Report factor attribution; alternative target inactive
Numeric model Ridge, alpha 10, 40 frozen features
Holdings 40
Base sizing Equal weight
Invested weight 70%; remaining 30% cash
Hold rule 26-week minimum hold, unless required removal
Exit boundary Rank 200
Optional-trade threshold 1% portfolio weight
Sector cap 25%
Execution Next available open
Cost model 8 bps one way plus $10 per order
Pair sleeve 0%
Slow NLP contribution 0% pending better data and a new frozen test
Tactical news sleeve Disabled

This contract is a reproducible research baseline, not a recommendation for live capital. Its 2024 through 2025 Q1 confirmation is already observed and failed two of four gates.

The contract is now enforced by configs/experiments/final_reference_v1.yaml and python -m src.cli build-final-version. The builder verifies frozen artifact consistency, inactive-module weights, lockbox boundaries, input hashes, and FF3 attribution before emitting the final research-reference package. See Final version.

Governance for any future version

A future module can enter the reference portfolio only when all of the following are true:

  1. Its data are point-in-time, sufficiently broad, and independently audited.
  2. Its parameters and success gates are frozen before evaluation.
  3. It adds value to an unchanged baseline under identical dates, holdings, and costs.
  4. A permanent shuffled or randomized placebo is beaten at the declared level.
  5. Its block-bootstrap confidence interval meets the declared lower-bound gate.
  6. Turnover, drawdown, capacity, and implementation costs remain acceptable.
  7. It passes once on a genuinely untouched period without tuning.

Observed development and confirmation periods must never be relabeled as new lockboxes.

Recommended next project phase

The next version should begin with data quality rather than another model:

Every candidate should report FF3 alpha and market, size, and value loadings beside raw return. The FF3-neutral prediction target remains an inactive research option until it beats permanent placebos and confidence gates on a genuinely new period.

  1. Obtain official effective-dated sectors and second-source delisted-symbol prices.
  2. Trial a historical news vendor with verified timestamps, broad ticker coverage, and explicit company/sector/macro scope labels.
  3. Build a transparent selector using residual momentum, quality, low volatility, liquidity, and costs before adding AI.
  4. Use an LLM only as a versioned structured-event extractor with cited evidence—not as an unconstrained stock picker.
  5. Freeze a new combined contract on a separate development period.
  6. Wait for or acquire a genuinely untouched confirmation period.

Pair v5, slow-NLP v5, and the existing numeric confirmation must not be retuned on their observed samples. New ideas require a new manifest and a new development boundary.

Valid public description

Built a point-in-time portfolio research platform covering data ingestion, residual-return ranking, realistic execution, FinBERT/topic features, and cointegration-based pair testing. Corrected material backtest accounting defects and evaluated every incremental module with shuffled controls and block-bootstrap intervals; retained unconfirmed strategies as disabled research modules rather than overstating investment performance.

This description communicates the project's strongest achievement: trustworthy experimental engineering and disciplined interpretation.