Add regime gate walk-forward test (EVIDENCE#050)

- 3 detector types (dispersion/vol/HMM) × 14 configs across 5 years
- Dispersion gates: 0% trip rate everywhere (dead)
- Vol gates: trip differential +32-47pp but destroy returns in good years
- HMM gates: +6pp differential, hmm_0.7 improves 2023/2025 but kills 2026
- Guard candidate regime gate REFUTED (ch 11)
- Script: book/scripts/regime_gate_bt.py
- Results: book/data/regime_gate/regime_gate_trip_rates.csv
This commit is contained in:
zhaoli
2026-08-20 22:14:31 +00:00
parent 4831a2770c
commit 718b048df9
6 changed files with 1636 additions and 2 deletions
@@ -0,0 +1,71 @@
window,gate,start,end,trade_dates,gate_open,gate_closed,trip_rate,base_ann,base_sharpe,base_maxDD,gated_ann,gated_sharpe,gated_maxDD
2026,disp_0.010,2026-01-04,2026-08-19,157,157,0,0.0,0.255023,1.4465,-0.080671,0.255023,1.4465,-0.080671
2026,disp_0.015,2026-01-04,2026-08-19,157,157,0,0.0,0.255023,1.4465,-0.080671,0.255023,1.4465,-0.080671
2026,disp_0.020,2026-01-04,2026-08-19,157,157,0,0.0,0.255023,1.4465,-0.080671,0.255023,1.4465,-0.080671
2026,disp_0.025,2026-01-04,2026-08-19,157,157,0,0.0,0.255023,1.4465,-0.080671,0.255023,1.4465,-0.080671
2026,disp_0.030,2026-01-04,2026-08-19,157,157,0,0.0,0.255023,1.4465,-0.080671,0.255023,1.4465,-0.080671
2026,vol_low_max15,2026-01-04,2026-08-19,157,0,157,1.0,0.255023,1.4465,-0.080671,0.0,0.0,0.0
2026,vol_low_max20,2026-01-04,2026-08-19,157,12,145,0.9236,0.255023,1.4465,-0.080671,0.043049,1.1515,-0.023108
2026,vol_low_max25,2026-01-04,2026-08-19,157,58,99,0.6306,0.255023,1.4465,-0.080671,-0.016384,-0.1645,-0.108398
2026,vol_10_25,2026-01-04,2026-08-19,157,58,99,0.6306,0.255023,1.4465,-0.080671,-0.016384,-0.1645,-0.108398
2026,vol_10_30,2026-01-04,2026-08-19,157,157,0,0.0,0.255023,1.4465,-0.080671,0.255023,1.4465,-0.080671
2026,hmm_0.3,2026-01-04,2026-08-19,157,157,0,0.0,0.255023,1.4465,-0.080671,0.255023,1.4465,-0.080671
2026,hmm_0.5,2026-01-04,2026-08-19,157,153,4,0.0255,0.255023,1.4465,-0.080671,0.149795,0.9136,-0.080671
2026,hmm_0.7,2026-01-04,2026-08-19,157,99,58,0.3694,0.255023,1.4465,-0.080671,0.10771,1.0292,-0.057741
2026,hmm_0.9,2026-01-04,2026-08-19,157,0,157,1.0,0.255023,1.4465,-0.080671,0.0,0.0,0.0
2025,disp_0.010,2025-01-02,2025-12-31,250,250,0,0.0,0.177515,0.8573,-0.217417,0.177515,0.8573,-0.217417
2025,disp_0.015,2025-01-02,2025-12-31,250,250,0,0.0,0.177515,0.8573,-0.217417,0.177515,0.8573,-0.217417
2025,disp_0.020,2025-01-02,2025-12-31,250,250,0,0.0,0.177515,0.8573,-0.217417,0.177515,0.8573,-0.217417
2025,disp_0.025,2025-01-02,2025-12-31,250,250,0,0.0,0.177515,0.8573,-0.217417,0.177515,0.8573,-0.217417
2025,disp_0.030,2025-01-02,2025-12-31,250,250,0,0.0,0.177515,0.8573,-0.217417,0.177515,0.8573,-0.217417
2025,vol_low_max15,2025-01-02,2025-12-31,250,0,250,1.0,0.177515,0.8573,-0.217417,0.0,0.0,0.0
2025,vol_low_max20,2025-01-02,2025-12-31,250,90,160,0.64,0.177515,0.8573,-0.217417,0.144812,2.0398,-0.0378
2025,vol_low_max25,2025-01-02,2025-12-31,250,178,72,0.288,0.177515,0.8573,-0.217417,0.127917,1.0934,-0.11916
2025,vol_10_25,2025-01-02,2025-12-31,250,178,72,0.288,0.177515,0.8573,-0.217417,0.127917,1.0934,-0.11916
2025,vol_10_30,2025-01-02,2025-12-31,250,212,38,0.152,0.177515,0.8573,-0.217417,0.173997,1.2001,-0.130753
2025,hmm_0.3,2025-01-02,2025-12-31,250,244,6,0.024,0.177515,0.8573,-0.217417,0.221577,1.364,-0.14578
2025,hmm_0.5,2025-01-02,2025-12-31,250,233,17,0.068,0.177515,0.8573,-0.217417,0.280047,1.9219,-0.070373
2025,hmm_0.7,2025-01-02,2025-12-31,250,185,65,0.26,0.177515,0.8573,-0.217417,0.268006,2.4144,-0.070373
2025,hmm_0.9,2025-01-02,2025-12-31,250,0,250,1.0,0.177515,0.8573,-0.217417,0.0,0.0,0.0
2024,disp_0.010,2024-01-02,2024-12-31,253,253,0,0.0,0.08229,0.5594,-0.10685,0.08229,0.5594,-0.10685
2024,disp_0.015,2024-01-02,2024-12-31,253,253,0,0.0,0.08229,0.5594,-0.10685,0.08229,0.5594,-0.10685
2024,disp_0.020,2024-01-02,2024-12-31,253,253,0,0.0,0.08229,0.5594,-0.10685,0.08229,0.5594,-0.10685
2024,disp_0.025,2024-01-02,2024-12-31,253,253,0,0.0,0.08229,0.5594,-0.10685,0.08229,0.5594,-0.10685
2024,disp_0.030,2024-01-02,2024-12-31,253,253,0,0.0,0.08229,0.5594,-0.10685,0.08229,0.5594,-0.10685
2024,vol_low_max15,2024-01-02,2024-12-31,253,0,253,1.0,0.08229,0.5594,-0.10685,0.0,0.0,0.0
2024,vol_low_max20,2024-01-02,2024-12-31,253,86,167,0.6601,0.08229,0.5594,-0.10685,0.000386,0.0056,-0.063954
2024,vol_low_max25,2024-01-02,2024-12-31,253,179,74,0.2925,0.08229,0.5594,-0.10685,0.081492,0.6993,-0.070375
2024,vol_10_25,2024-01-02,2024-12-31,253,179,74,0.2925,0.08229,0.5594,-0.10685,0.081492,0.6993,-0.070375
2024,vol_10_30,2024-01-02,2024-12-31,253,234,19,0.0751,0.08229,0.5594,-0.10685,0.089809,0.6617,-0.068417
2024,hmm_0.3,2024-01-02,2024-12-31,253,253,0,0.0,0.08229,0.5594,-0.10685,0.08229,0.5594,-0.10685
2024,hmm_0.5,2024-01-02,2024-12-31,253,249,4,0.0158,0.08229,0.5594,-0.10685,0.136453,0.959,-0.081611
2024,hmm_0.7,2024-01-02,2024-12-31,253,213,40,0.1581,0.08229,0.5594,-0.10685,0.172432,1.6081,-0.051163
2024,hmm_0.9,2024-01-02,2024-12-31,253,0,253,1.0,0.08229,0.5594,-0.10685,0.0,0.0,0.0
2023,disp_0.010,2023-01-03,2023-12-29,250,250,0,0.0,-0.047644,-0.2738,-0.197856,-0.047644,-0.2738,-0.197856
2023,disp_0.015,2023-01-03,2023-12-29,250,250,0,0.0,-0.047644,-0.2738,-0.197856,-0.047644,-0.2738,-0.197856
2023,disp_0.020,2023-01-03,2023-12-29,250,250,0,0.0,-0.047644,-0.2738,-0.197856,-0.047644,-0.2738,-0.197856
2023,disp_0.025,2023-01-03,2023-12-29,250,250,0,0.0,-0.047644,-0.2738,-0.197856,-0.047644,-0.2738,-0.197856
2023,disp_0.030,2023-01-03,2023-12-29,250,250,0,0.0,-0.047644,-0.2738,-0.197856,-0.047644,-0.2738,-0.197856
2023,vol_low_max15,2023-01-03,2023-12-29,250,0,250,1.0,-0.047644,-0.2738,-0.197856,0.0,0.0,0.0
2023,vol_low_max20,2023-01-03,2023-12-29,250,103,147,0.588,-0.047644,-0.2738,-0.197856,-0.052602,-0.5107,-0.148726
2023,vol_low_max25,2023-01-03,2023-12-29,250,245,5,0.02,-0.047644,-0.2738,-0.197856,-0.077097,-0.4555,-0.179606
2023,vol_10_25,2023-01-03,2023-12-29,250,245,5,0.02,-0.047644,-0.2738,-0.197856,-0.077097,-0.4555,-0.179606
2023,vol_10_30,2023-01-03,2023-12-29,250,250,0,0.0,-0.047644,-0.2738,-0.197856,-0.047644,-0.2738,-0.197856
2023,hmm_0.3,2023-01-03,2023-12-29,250,250,0,0.0,-0.047644,-0.2738,-0.197856,-0.047644,-0.2738,-0.197856
2023,hmm_0.5,2023-01-03,2023-12-29,250,242,8,0.032,-0.047644,-0.2738,-0.197856,-0.005112,-0.0312,-0.171319
2023,hmm_0.7,2023-01-03,2023-12-29,250,119,131,0.524,-0.047644,-0.2738,-0.197856,0.006276,0.0709,-0.084209
2023,hmm_0.9,2023-01-03,2023-12-29,250,0,250,1.0,-0.047644,-0.2738,-0.197856,0.0,0.0,0.0
2021,disp_0.010,2021-01-04,2021-12-31,252,252,0,0.0,0.18367,1.0979,-0.102651,0.18367,1.0979,-0.102651
2021,disp_0.015,2021-01-04,2021-12-31,252,252,0,0.0,0.18367,1.0979,-0.102651,0.18367,1.0979,-0.102651
2021,disp_0.020,2021-01-04,2021-12-31,252,252,0,0.0,0.18367,1.0979,-0.102651,0.18367,1.0979,-0.102651
2021,disp_0.025,2021-01-04,2021-12-31,252,252,0,0.0,0.18367,1.0979,-0.102651,0.18367,1.0979,-0.102651
2021,disp_0.030,2021-01-04,2021-12-31,252,252,0,0.0,0.18367,1.0979,-0.102651,0.18367,1.0979,-0.102651
2021,vol_low_max15,2021-01-04,2021-12-31,252,0,252,1.0,0.18367,1.0979,-0.102651,0.0,0.0,0.0
2021,vol_low_max20,2021-01-04,2021-12-31,252,111,141,0.5595,0.18367,1.0979,-0.102651,0.052323,0.6232,-0.065118
2021,vol_low_max25,2021-01-04,2021-12-31,252,212,40,0.1587,0.18367,1.0979,-0.102651,0.099622,0.7322,-0.077033
2021,vol_10_25,2021-01-04,2021-12-31,252,212,40,0.1587,0.18367,1.0979,-0.102651,0.099622,0.7322,-0.077033
2021,vol_10_30,2021-01-04,2021-12-31,252,252,0,0.0,0.18367,1.0979,-0.102651,0.18367,1.0979,-0.102651
2021,hmm_0.3,2021-01-04,2021-12-31,252,252,0,0.0,0.18367,1.0979,-0.102651,0.18367,1.0979,-0.102651
2021,hmm_0.5,2021-01-04,2021-12-31,252,243,9,0.0357,0.18367,1.0979,-0.102651,0.180238,1.1183,-0.116244
2021,hmm_0.7,2021-01-04,2021-12-31,252,190,62,0.246,0.18367,1.0979,-0.102651,0.184264,1.7758,-0.095388
2021,hmm_0.9,2021-01-04,2021-12-31,252,0,252,1.0,0.18367,1.0979,-0.102651,0.0,0.0,0.0
1 window gate start end trade_dates gate_open gate_closed trip_rate base_ann base_sharpe base_maxDD gated_ann gated_sharpe gated_maxDD
2 2026 disp_0.010 2026-01-04 2026-08-19 157 157 0 0.0 0.255023 1.4465 -0.080671 0.255023 1.4465 -0.080671
3 2026 disp_0.015 2026-01-04 2026-08-19 157 157 0 0.0 0.255023 1.4465 -0.080671 0.255023 1.4465 -0.080671
4 2026 disp_0.020 2026-01-04 2026-08-19 157 157 0 0.0 0.255023 1.4465 -0.080671 0.255023 1.4465 -0.080671
5 2026 disp_0.025 2026-01-04 2026-08-19 157 157 0 0.0 0.255023 1.4465 -0.080671 0.255023 1.4465 -0.080671
6 2026 disp_0.030 2026-01-04 2026-08-19 157 157 0 0.0 0.255023 1.4465 -0.080671 0.255023 1.4465 -0.080671
7 2026 vol_low_max15 2026-01-04 2026-08-19 157 0 157 1.0 0.255023 1.4465 -0.080671 0.0 0.0 0.0
8 2026 vol_low_max20 2026-01-04 2026-08-19 157 12 145 0.9236 0.255023 1.4465 -0.080671 0.043049 1.1515 -0.023108
9 2026 vol_low_max25 2026-01-04 2026-08-19 157 58 99 0.6306 0.255023 1.4465 -0.080671 -0.016384 -0.1645 -0.108398
10 2026 vol_10_25 2026-01-04 2026-08-19 157 58 99 0.6306 0.255023 1.4465 -0.080671 -0.016384 -0.1645 -0.108398
11 2026 vol_10_30 2026-01-04 2026-08-19 157 157 0 0.0 0.255023 1.4465 -0.080671 0.255023 1.4465 -0.080671
12 2026 hmm_0.3 2026-01-04 2026-08-19 157 157 0 0.0 0.255023 1.4465 -0.080671 0.255023 1.4465 -0.080671
13 2026 hmm_0.5 2026-01-04 2026-08-19 157 153 4 0.0255 0.255023 1.4465 -0.080671 0.149795 0.9136 -0.080671
14 2026 hmm_0.7 2026-01-04 2026-08-19 157 99 58 0.3694 0.255023 1.4465 -0.080671 0.10771 1.0292 -0.057741
15 2026 hmm_0.9 2026-01-04 2026-08-19 157 0 157 1.0 0.255023 1.4465 -0.080671 0.0 0.0 0.0
16 2025 disp_0.010 2025-01-02 2025-12-31 250 250 0 0.0 0.177515 0.8573 -0.217417 0.177515 0.8573 -0.217417
17 2025 disp_0.015 2025-01-02 2025-12-31 250 250 0 0.0 0.177515 0.8573 -0.217417 0.177515 0.8573 -0.217417
18 2025 disp_0.020 2025-01-02 2025-12-31 250 250 0 0.0 0.177515 0.8573 -0.217417 0.177515 0.8573 -0.217417
19 2025 disp_0.025 2025-01-02 2025-12-31 250 250 0 0.0 0.177515 0.8573 -0.217417 0.177515 0.8573 -0.217417
20 2025 disp_0.030 2025-01-02 2025-12-31 250 250 0 0.0 0.177515 0.8573 -0.217417 0.177515 0.8573 -0.217417
21 2025 vol_low_max15 2025-01-02 2025-12-31 250 0 250 1.0 0.177515 0.8573 -0.217417 0.0 0.0 0.0
22 2025 vol_low_max20 2025-01-02 2025-12-31 250 90 160 0.64 0.177515 0.8573 -0.217417 0.144812 2.0398 -0.0378
23 2025 vol_low_max25 2025-01-02 2025-12-31 250 178 72 0.288 0.177515 0.8573 -0.217417 0.127917 1.0934 -0.11916
24 2025 vol_10_25 2025-01-02 2025-12-31 250 178 72 0.288 0.177515 0.8573 -0.217417 0.127917 1.0934 -0.11916
25 2025 vol_10_30 2025-01-02 2025-12-31 250 212 38 0.152 0.177515 0.8573 -0.217417 0.173997 1.2001 -0.130753
26 2025 hmm_0.3 2025-01-02 2025-12-31 250 244 6 0.024 0.177515 0.8573 -0.217417 0.221577 1.364 -0.14578
27 2025 hmm_0.5 2025-01-02 2025-12-31 250 233 17 0.068 0.177515 0.8573 -0.217417 0.280047 1.9219 -0.070373
28 2025 hmm_0.7 2025-01-02 2025-12-31 250 185 65 0.26 0.177515 0.8573 -0.217417 0.268006 2.4144 -0.070373
29 2025 hmm_0.9 2025-01-02 2025-12-31 250 0 250 1.0 0.177515 0.8573 -0.217417 0.0 0.0 0.0
30 2024 disp_0.010 2024-01-02 2024-12-31 253 253 0 0.0 0.08229 0.5594 -0.10685 0.08229 0.5594 -0.10685
31 2024 disp_0.015 2024-01-02 2024-12-31 253 253 0 0.0 0.08229 0.5594 -0.10685 0.08229 0.5594 -0.10685
32 2024 disp_0.020 2024-01-02 2024-12-31 253 253 0 0.0 0.08229 0.5594 -0.10685 0.08229 0.5594 -0.10685
33 2024 disp_0.025 2024-01-02 2024-12-31 253 253 0 0.0 0.08229 0.5594 -0.10685 0.08229 0.5594 -0.10685
34 2024 disp_0.030 2024-01-02 2024-12-31 253 253 0 0.0 0.08229 0.5594 -0.10685 0.08229 0.5594 -0.10685
35 2024 vol_low_max15 2024-01-02 2024-12-31 253 0 253 1.0 0.08229 0.5594 -0.10685 0.0 0.0 0.0
36 2024 vol_low_max20 2024-01-02 2024-12-31 253 86 167 0.6601 0.08229 0.5594 -0.10685 0.000386 0.0056 -0.063954
37 2024 vol_low_max25 2024-01-02 2024-12-31 253 179 74 0.2925 0.08229 0.5594 -0.10685 0.081492 0.6993 -0.070375
38 2024 vol_10_25 2024-01-02 2024-12-31 253 179 74 0.2925 0.08229 0.5594 -0.10685 0.081492 0.6993 -0.070375
39 2024 vol_10_30 2024-01-02 2024-12-31 253 234 19 0.0751 0.08229 0.5594 -0.10685 0.089809 0.6617 -0.068417
40 2024 hmm_0.3 2024-01-02 2024-12-31 253 253 0 0.0 0.08229 0.5594 -0.10685 0.08229 0.5594 -0.10685
41 2024 hmm_0.5 2024-01-02 2024-12-31 253 249 4 0.0158 0.08229 0.5594 -0.10685 0.136453 0.959 -0.081611
42 2024 hmm_0.7 2024-01-02 2024-12-31 253 213 40 0.1581 0.08229 0.5594 -0.10685 0.172432 1.6081 -0.051163
43 2024 hmm_0.9 2024-01-02 2024-12-31 253 0 253 1.0 0.08229 0.5594 -0.10685 0.0 0.0 0.0
44 2023 disp_0.010 2023-01-03 2023-12-29 250 250 0 0.0 -0.047644 -0.2738 -0.197856 -0.047644 -0.2738 -0.197856
45 2023 disp_0.015 2023-01-03 2023-12-29 250 250 0 0.0 -0.047644 -0.2738 -0.197856 -0.047644 -0.2738 -0.197856
46 2023 disp_0.020 2023-01-03 2023-12-29 250 250 0 0.0 -0.047644 -0.2738 -0.197856 -0.047644 -0.2738 -0.197856
47 2023 disp_0.025 2023-01-03 2023-12-29 250 250 0 0.0 -0.047644 -0.2738 -0.197856 -0.047644 -0.2738 -0.197856
48 2023 disp_0.030 2023-01-03 2023-12-29 250 250 0 0.0 -0.047644 -0.2738 -0.197856 -0.047644 -0.2738 -0.197856
49 2023 vol_low_max15 2023-01-03 2023-12-29 250 0 250 1.0 -0.047644 -0.2738 -0.197856 0.0 0.0 0.0
50 2023 vol_low_max20 2023-01-03 2023-12-29 250 103 147 0.588 -0.047644 -0.2738 -0.197856 -0.052602 -0.5107 -0.148726
51 2023 vol_low_max25 2023-01-03 2023-12-29 250 245 5 0.02 -0.047644 -0.2738 -0.197856 -0.077097 -0.4555 -0.179606
52 2023 vol_10_25 2023-01-03 2023-12-29 250 245 5 0.02 -0.047644 -0.2738 -0.197856 -0.077097 -0.4555 -0.179606
53 2023 vol_10_30 2023-01-03 2023-12-29 250 250 0 0.0 -0.047644 -0.2738 -0.197856 -0.047644 -0.2738 -0.197856
54 2023 hmm_0.3 2023-01-03 2023-12-29 250 250 0 0.0 -0.047644 -0.2738 -0.197856 -0.047644 -0.2738 -0.197856
55 2023 hmm_0.5 2023-01-03 2023-12-29 250 242 8 0.032 -0.047644 -0.2738 -0.197856 -0.005112 -0.0312 -0.171319
56 2023 hmm_0.7 2023-01-03 2023-12-29 250 119 131 0.524 -0.047644 -0.2738 -0.197856 0.006276 0.0709 -0.084209
57 2023 hmm_0.9 2023-01-03 2023-12-29 250 0 250 1.0 -0.047644 -0.2738 -0.197856 0.0 0.0 0.0
58 2021 disp_0.010 2021-01-04 2021-12-31 252 252 0 0.0 0.18367 1.0979 -0.102651 0.18367 1.0979 -0.102651
59 2021 disp_0.015 2021-01-04 2021-12-31 252 252 0 0.0 0.18367 1.0979 -0.102651 0.18367 1.0979 -0.102651
60 2021 disp_0.020 2021-01-04 2021-12-31 252 252 0 0.0 0.18367 1.0979 -0.102651 0.18367 1.0979 -0.102651
61 2021 disp_0.025 2021-01-04 2021-12-31 252 252 0 0.0 0.18367 1.0979 -0.102651 0.18367 1.0979 -0.102651
62 2021 disp_0.030 2021-01-04 2021-12-31 252 252 0 0.0 0.18367 1.0979 -0.102651 0.18367 1.0979 -0.102651
63 2021 vol_low_max15 2021-01-04 2021-12-31 252 0 252 1.0 0.18367 1.0979 -0.102651 0.0 0.0 0.0
64 2021 vol_low_max20 2021-01-04 2021-12-31 252 111 141 0.5595 0.18367 1.0979 -0.102651 0.052323 0.6232 -0.065118
65 2021 vol_low_max25 2021-01-04 2021-12-31 252 212 40 0.1587 0.18367 1.0979 -0.102651 0.099622 0.7322 -0.077033
66 2021 vol_10_25 2021-01-04 2021-12-31 252 212 40 0.1587 0.18367 1.0979 -0.102651 0.099622 0.7322 -0.077033
67 2021 vol_10_30 2021-01-04 2021-12-31 252 252 0 0.0 0.18367 1.0979 -0.102651 0.18367 1.0979 -0.102651
68 2021 hmm_0.3 2021-01-04 2021-12-31 252 252 0 0.0 0.18367 1.0979 -0.102651 0.18367 1.0979 -0.102651
69 2021 hmm_0.5 2021-01-04 2021-12-31 252 243 9 0.0357 0.18367 1.0979 -0.102651 0.180238 1.1183 -0.116244
70 2021 hmm_0.7 2021-01-04 2021-12-31 252 190 62 0.246 0.18367 1.0979 -0.102651 0.184264 1.7758 -0.095388
71 2021 hmm_0.9 2021-01-04 2021-12-31 252 0 252 1.0 0.18367 1.0979 -0.102651 0.0 0.0 0.0
File diff suppressed because it is too large Load Diff