Skip to content

Commit 73ad131

Browse files
committed
Audit price integrity and tail-risk controls
1 parent 8fc4777 commit 73ad131

31 files changed

Lines changed: 3937 additions & 81 deletions

README.md

Lines changed: 64 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,13 @@ repeatedly challenging attractive backtests and keeping the failed tests.
5050
inconclusive. Negative results were retained rather than blended into an
5151
ever-larger strategy.
5252
[Explore the dated experiment archive](https://github.com/HanSun103/AI-Driven-Portfolio-Optimization-Backtesting-System/tree/archive-experiments/docs/experiments)
53-
5. **The live horizon was redesigned.** The one-session monitor accumulated
54-
observations quickly but tested the wrong economic horizon and created
55-
extreme turnover. A matched historical sweep identified a 10-to-20-session
56-
plateau, with 20 sessions as the leading, but not uniquely proven, candidate.
57-
[Read the horizon decision](docs/experiments/2026-07-28-live-horizon-decision.md)
53+
5. **The live horizon was redesigned, and its historical estimate is being
54+
re-audited.** The one-session monitor accumulated observations quickly but
55+
tested the wrong economic horizon and created extreme turnover. The original
56+
matched horizon sweep used the now-invalidated price panel. The active
57+
5/10/20-session comparison remains useful for collecting prospective
58+
evidence, but 20 sessions is provisional until the corrected sweep is run.
59+
[Read the data-integrity audit](docs/experiments/2026-07-30-price-repair-oos-audit.md)
5860
6. **The project is now a focused paper-live experiment.** The active system
5961
refreshes real market/news data, applies strict FinBERT NLP, independently
6062
tunes Ridge and XGBoost, freezes daily forecasts, and tracks separately
@@ -64,26 +66,29 @@ repeatedly challenging attractive backtests and keeping the failed tests.
6466
The long research history remains available through the links above; the rest
6567
of this README describes only the final active system and its current evidence.
6668

67-
### Ridge, XGBoost, and ensemble development backtest
69+
### Corrected Ridge, XGBoost, and ensemble development backtest
6870

69-
This is the complete portfolio comparison used by the current README
70-
visualization. It covers 182 weekly observations from 2020-01-10 through
71-
2023-06-30. Each model holds 40 equal-weight stocks with a 25% sector cap.
72-
Results include 8 basis points per one-way traded weight and a $10 fixed fee
73-
per trade.
71+
An audit on July 30 found that the historical price-repair merge could mix
72+
split-adjusted and unadjusted rows with the same index. The July 20 and July 27
73+
tables were invalidated. The table below is the corrected replay after rebuilding
74+
prices, sectors, labels, current features, and Alpha158 factors, then refitting
75+
the saved fold specifications. It covers 182 weekly observations from
76+
2020-01-10 through 2023-06-30. Each model holds 40 equal-weight stocks with a
77+
25% sector cap. Results include 8 basis points per one-way traded weight and a
78+
$10 fixed fee per trade.
7479

7580
| Model and portfolio | Model construction | Mean rank IC | Net cumulative return | Net CAGR | Sharpe | Maximum drawdown |
7681
|---|---|---:|---:|---:|---:|---:|
77-
| Ridge | Linear rank model | 0.00560 | 103.88% | 22.57% | 0.77 | -27.37% |
78-
| XGBoost ranker | Nonlinear pairwise rank model | 0.00222 | 190.28% | 35.59% | 0.97 | -39.44% |
79-
| Ridge-XGBoost ensemble | Expanding prior-fold blend; 50/50 in the first fold, then 25% Ridge and 75% XGBoost | 0.00188 | 110.05% | 23.62% | 0.78 | -35.92% |
82+
| Ridge | Linear rank model | 0.02027 | 66.96% | 15.77% | 0.61 | -40.59% |
83+
| XGBoost ranker | Nonlinear pairwise rank model | 0.00724 | 2.11% | 0.60% | 0.17 | -41.21% |
84+
| Ridge-XGBoost ensemble | Expanding prior-fold blend; historical selection now favors Ridge | 0.01805 | 49.68% | 12.21% | 0.52 | -37.71% |
8085
| SPY benchmark | Buy and hold with the experiment's 0.5% annual management fee | N/A | 39.58% | 10.00% | 0.54 | -34.12% |
8186

82-
The ensemble improved the top-40 excess-return point estimate over Ridge but
83-
did not beat XGBoost. Its active-return confidence interval crossed zero and
84-
its shuffled-score information-ratio p-value was `0.089`, so the experiment
85-
did not establish a promotion claim.
86-
[Read the Ridge-XGBoost rank ensemble experiment](docs/experiments/2026-07-27-ridge-xgb-rank-ensemble.md)
87+
Ridge is the strongest corrected historical model. XGBoost no longer supports
88+
the earlier claim of stronger top-tail selection. The active-return confidence
89+
intervals still cross zero, and the final chronological fold trails SPY, so
90+
this remains development evidence rather than a promotion claim.
91+
[Read the price-repair and OOS evidence audit](docs/experiments/2026-07-30-price-repair-oos-audit.md)
8792

8893
## Architecture
8994

@@ -161,14 +166,19 @@ flowchart TD
161166

162167
| Finding | Current evidence | Boundary |
163168
|---|---|---|
164-
| Winner selection is more promising than raw-return prediction | Repaired weekly OOS rank IC `0.0059`; top-40 excess `0.1686%` per week; shuffled-score p-value `0.0099` | Average signal is thin, unstable by year, and the active-return confidence interval crosses zero |
169+
| Winner selection is more promising than raw-return prediction | Corrected Ridge rank IC `0.02027` and top-40 excess `0.2146%` per weekly observation | Average signal is thin, unstable by year, and the active-return confidence interval crosses zero |
165170
| Sentiment appears useful | Technical-plus-sentiment point estimates exceeded technical-only at 5, 10, and 20 sessions | The comparison does not yet prove a causal NLP increment; prior robustness gates were inconclusive |
166-
| Twenty sessions is the leading horizon | Full-OOS annualized active point estimates: 5d `4.53%`, 10d `6.65%`, 20d `8.59%` | Twenty versus ten sessions was not statistically distinguishable (`t = 0.33`) |
171+
| The best horizon is unresolved | The original 5/10/20-session sweep was invalidated by the July 30 price-repair audit | Keep collecting all three prospective arms and rerun the matched historical sweep on corrected data |
167172
| Rebalancing behavior is model-specific | Over six July 20-28 sessions, freezing improved Ridge net return by `3.93` points; daily replacement improved XGBoost by only `0.53` points net | Six sessions cannot determine permanent policy; a preregistered buffer comparison is required |
173+
| Negative selected stocks persist, while severe losses cluster in stressed markets | Ridge sign false positives occur in every half-year; 2020 H1 and 2022 H1 contain `70.43%` of severe observations and `75.79%` of severe-loss drag | The realized market state is explanatory, not available at decision time; the causal SPY regime does not reliably identify losing weeks |
174+
| A bounded tail veto can reduce direct severe-loss drag | The fully invested historical A/B treatment reduced severe-loss contribution by about `8.1%` relative, with a paired interval entirely below zero | CVaR improvement remained uncertain, return non-inferiority failed its interval, active arms required a `30%` veto budget, and many rejected stocks were winners |
168175
| Live operation is feasible | Current market/news refresh, strict local FinBERT, purged tuning, frozen forecasts, and immutable manifests completed | The redesigned live forecasts have not matured; there is no live-return claim yet |
169176

170-
The detailed decision record is
171-
[Live forecast-horizon evidence](docs/experiments/2026-07-28-live-horizon-decision.md).
177+
Detailed decision records:
178+
179+
- [Live forecast-horizon evidence](docs/experiments/2026-07-28-live-horizon-decision.md)
180+
- [Backtest tail-risk timeline](docs/experiments/2026-07-30-backtest-tail-risk-timeline.md)
181+
- [Severe-loss risk-control A/B experiment](docs/experiments/2026-07-30-severe-loss-risk-control-ab.md)
172182

173183
## Visual evidence
174184

@@ -416,6 +426,33 @@ strategies.
416426
Failed experiments are retained as evidence. They are not removed merely
417427
because they weaken the preferred narrative.
418428

429+
## Future work
430+
431+
The next risk-control version should not increase the current treatment's
432+
authority. The first historical A/B result is inconclusive and remains disabled.
433+
Future work will:
434+
435+
1. add decision-time overnight-gap, recent-drawdown, liquidity-deterioration,
436+
earnings-proximity, SPY-stress, and timestamp-safe event features;
437+
2. compare transparent rules, class-weighted models, focal-style loss, and
438+
conditional quantiles inside purged temporal folds;
439+
3. target fewer, higher-confidence removals instead of depending on a 30%
440+
veto budget;
441+
4. preserve the fully invested 40-stock Ridge control so cash exposure cannot
442+
create an artificial risk improvement;
443+
5. optimize severe-loss precision and recall together with rejected-winner
444+
cost, CVaR, drawdown, turnover, and return non-inferiority;
445+
6. evaluate stability separately across stressed and ordinary periods using
446+
only causal regime inputs;
447+
7. extend point-in-time testing beyond the current three-and-a-half-year
448+
portfolio history; and
449+
8. start a prospective shadow A/B test only after a frozen historical treatment
450+
passes both paired risk improvement and return non-inferiority.
451+
452+
The preregistered workflow and failure history are maintained in the
453+
[risk-control A/B plan](docs/design/SEVERE_LOSS_RISK_CONTROL_AB_PLAN.md) and
454+
[false-positive research record](docs/research/2026-07-30-false-positive-and-tail-risk-control.md).
455+
419456
## Known limitations
420457

421458
1. No redesigned 20-session paper-live forecast has matured yet.
@@ -445,7 +482,10 @@ because they weaken the preferred narrative.
445482
9. Scheduled full top-40 replacement remains under audit; the six-session
446483
ablation is too short to activate a freeze or buffer.
447484
10. Static cost assumptions do not establish capacity, taxes, borrow
448-
availability, market impact, or partial-fill behavior.
485+
availability, market impact, or partial-fill behavior.
486+
11. The first fully invested severe-loss A/B treatment reduced direct tail
487+
drag but did not establish CVaR improvement or return non-inferiority. It
488+
remains inactive.
449489

450490
## Research disclaimer
451491

configs/experiments/live_forward_20d.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ live_forward_20d:
2121
- rank_margin_buffer
2222
- score_percentile_buffer
2323
training_lookback_sessions: 756
24+
# Increment after a historical data correction that invalidates fitted models.
25+
training_data_revision: 2
2426
holdings: 40
2527
invested_weight: 1.0
2628
maximum_sector_fraction: 0.25

docs/FINAL_VERSION.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
# Final research-reference version
22

3+
> **Evidence correction, July 30, 2026:** performance estimates built from the
4+
> pre-correction repaired price panel are invalid. The design record remains
5+
> useful, but its quantitative claims must not be cited. See the
6+
> [price-repair and OOS evidence audit](experiments/2026-07-30-price-repair-oos-audit.md).
7+
38
Status: built and verified; not validated live alpha
49

510
## Current note
611

712
This final-reference package remains the conservative fail-closed build from the earlier frozen
8-
v4 contract. A later repaired development run found stronger evidence for the full weekly
9-
rank-40 ML stock-selection direction: 37.22% net CAGR, 0.99 Sharpe, and -22.77% maximum drawdown
10-
from 2020-04-24 through 2023-06-30. That newer result is promising but still development-only.
11-
It should be treated as the next candidate direction to freeze and confirm, not as a replacement
12-
for a passed final alpha claim.
13+
v4 contract. The corrected July 30 development replay identifies Ridge as the strongest historical
14+
rank-40 candidate, with 15.77% net CAGR, 0.61 Sharpe, and -40.59% maximum drawdown from 2020
15+
through 2023 H1. Its active-return confidence interval crosses zero and its final chronological
16+
fold trails SPY. It is a candidate to test prospectively, not a passed alpha claim.
1317

1418
## Purpose
1519

0 commit comments

Comments
 (0)