Files
sam cfc27a38de Rewrite as a probabilistic model with walk-forward evaluation.
Replace the 2024 model (model.py, ~2000 lines) with the btcmodel package, the
baseline for future work:

- Forecasts are quantiles of log price at each horizon, scored with CRPS in a
  walk-forward backtest (origins every 30 days from 2014, horizons 1 month to
  4 years). Skill is relative to a zero-drift random walk, with circular
  block-bootstrap intervals and a count of independent windows.
- Development data stops at 2024-11-26, the last day the 2024 model saw.
  Later outcomes are a holdout, scored only by `backtest --holdout`.
- Models: random_walk, drift_rw, and cycle (the 2024 model's cycle-position
  drift, now kernel-smoothed and recency-weighted). On development data
  nothing beats the random walk with confidence; cycle loses at every horizon.
- Prices: the Investing.com archive moves to data/ (cut at 2024-11-26; its
  last row was intraday) and is extended with Coinbase daily closes by
  `update`.

Also: Nix flake dev shell (Python 3.13, pandas 3), ruff in place of black,
pytest suite, and a rewritten README. NOTES.md is removed as inaccurate, and
poetry is dropped.
2026-09-24 02:19:02 -07:00

13 KiB

1dateclose
22024-11-2795951.19
32024-11-2895665.53
42024-11-2997490.56
52024-11-3096465.42
62024-12-0197263.18
72024-12-0295862.89
82024-12-0395924.52
92024-12-0498746.24
102024-12-0597044.23
112024-12-0699891.35
122024-12-0799929.32
132024-12-08101174.99
142024-12-0997324.81
152024-12-1096660.76
162024-12-11101202.11
172024-12-12100030.47
182024-12-13101428.75
192024-12-14101399.99
202024-12-15104447.76
212024-12-16106099.81
222024-12-17106136.99
232024-12-18100150.73
242024-12-1997372.21
252024-12-2097765.0
262024-12-2197230.08
272024-12-2295087.75
282024-12-2394764.56
292024-12-2498594.47
302024-12-2599346.28
312024-12-2695669.49
322024-12-2794171.89
332024-12-2895130.82
342024-12-2993563.35
352024-12-3092620.71
362024-12-3193354.22
372025-01-0194383.59
382025-01-0296903.19
392025-01-0398136.51
402025-01-0498209.85
412025-01-0598345.33
422025-01-06102279.41
432025-01-0796941.98
442025-01-0895036.63
452025-01-0992547.44
462025-01-1094701.18
472025-01-1194565.02
482025-01-1294509.62
492025-01-1394506.45
502025-01-1496534.96
512025-01-15100510.23
522025-01-1699981.78
532025-01-17104107.0
542025-01-18104435.0
552025-01-19101211.13
562025-01-20102145.43
572025-01-21106159.26
582025-01-22103667.11
592025-01-23103926.36
602025-01-24104850.27
612025-01-25104733.56
622025-01-26102563.0
632025-01-27102062.42
642025-01-28101290.0
652025-01-29103747.25
662025-01-30104742.64
672025-01-31102411.26
682025-02-01100623.85
692025-02-0297676.52
702025-02-03101460.2
712025-02-0497795.05
722025-02-0596638.33
732025-02-0696564.62
742025-02-0796537.08
752025-02-0896476.25
762025-02-0996475.82
772025-02-1097444.41
782025-02-1195774.08
792025-02-1297862.53
802025-02-1396625.29
812025-02-1497509.03
822025-02-1597596.94
832025-02-1696119.88
842025-02-1795781.8
852025-02-1895607.4
862025-02-1996632.03
872025-02-2098347.2
882025-02-2196157.03
892025-02-2296582.12
902025-02-2396265.98
912025-02-2491510.82
922025-02-2588583.74
932025-02-2684111.78
942025-02-2784625.19
952025-02-2884297.73
962025-03-0186018.76
972025-03-0294265.48
982025-03-0386161.1
992025-03-0487249.96
1002025-03-0590603.73
1012025-03-0689921.85
1022025-03-0786756.98
1032025-03-0886206.69
1042025-03-0980699.17
1052025-03-1078544.71
1062025-03-1182914.51
1072025-03-1283659.43
1082025-03-1381073.43
1092025-03-1483980.49
1102025-03-1584351.46
1112025-03-1682562.57
1122025-03-1784011.4
1132025-03-1882698.76
1142025-03-1986877.96
1152025-03-2084183.42
1162025-03-2184061.96
1172025-03-2283852.03
1182025-03-2386092.94
1192025-03-2487523.62
1202025-03-2587427.88
1212025-03-2686926.01
1222025-03-2787217.48
1232025-03-2884381.8
1242025-03-2982616.83
1252025-03-3082379.98
1262025-03-3182534.32
1272025-04-0185170.37
1282025-04-0282490.08
1292025-04-0383174.33
1302025-04-0483860.16
1312025-04-0583498.25
1322025-04-0678370.75
1332025-04-0779140.01
1342025-04-0876251.64
1352025-04-0982594.75
1362025-04-1079552.34
1372025-04-1183380.47
1382025-04-1285271.01
1392025-04-1383733.07
1402025-04-1484590.36
1412025-04-1583629.78
1422025-04-1684028.72
1432025-04-1784961.97
1442025-04-1884466.47
1452025-04-1985074.99
1462025-04-2085177.34
1472025-04-2187522.07
1482025-04-2293489.1
1492025-04-2393740.92
1502025-04-2494021.96
1512025-04-2594708.79
1522025-04-2694666.64
1532025-04-2793780.57
1542025-04-2895042.57
1552025-04-2994271.09
1562025-04-3094182.54
1572025-05-0196524.98
1582025-05-0296929.81
1592025-05-0395861.33
1602025-05-0494272.55
1612025-05-0594733.99
1622025-05-0696839.17
1632025-05-0797058.32
1642025-05-08103253.49
1652025-05-09102986.96
1662025-05-10104821.19
1672025-05-11104137.62
1682025-05-12102800.21
1692025-05-13104131.06
1702025-05-14103545.38
1712025-05-15103786.43
1722025-05-16103500.03
1732025-05-17103161.07
1742025-05-18106473.46
1752025-05-19105616.18
1762025-05-20106883.24
1772025-05-21109699.54
1782025-05-22111722.53
1792025-05-23107329.61
1802025-05-24107794.01
1812025-05-25109048.68
1822025-05-26109464.32
1832025-05-27108978.46
1842025-05-28107819.29
1852025-05-29105572.58
1862025-05-30104033.26
1872025-05-31104645.87
1882025-06-01105697.94
1892025-06-02105904.94
1902025-06-03105447.82
1912025-06-04104753.38
1922025-06-05101570.2
1932025-06-06104397.99
1942025-06-07105619.02
1952025-06-08105784.4
1962025-06-09110301.15
1972025-06-10110300.24
1982025-06-11108669.37
1992025-06-12105721.05
2002025-06-13106118.7
2012025-06-14105465.42
2022025-06-15105599.25
2032025-06-16106853.38
2042025-06-17104590.44
2052025-06-18104915.6
2062025-06-19104671.9
2072025-06-20103317.8
2082025-06-21102160.03
2092025-06-22100996.87
2102025-06-23105419.39
2112025-06-24106141.0
2122025-06-25107400.22
2132025-06-26107029.64
2142025-06-27107113.38
2152025-06-28107352.2
2162025-06-29108386.44
2172025-06-30107173.21
2182025-07-01105711.78
2192025-07-02108888.32
2202025-07-03109628.83
2212025-07-04108028.6
2222025-07-05108246.65
2232025-07-06109217.98
2242025-07-07108269.84
2252025-07-08108958.04
2262025-07-09111282.85
2272025-07-10116031.3
2282025-07-11117582.16
2292025-07-12117472.65
2302025-07-13119130.81
2312025-07-14119863.71
2322025-07-15117781.64
2332025-07-16118681.68
2342025-07-17119273.69
2352025-07-18118023.05
2362025-07-19117914.17
2372025-07-20117312.7
2382025-07-21117428.79
2392025-07-22120026.42
2402025-07-23118810.44
2412025-07-24118397.04
2422025-07-25117633.27
2432025-07-26117969.63
2442025-07-27119465.52
2452025-07-28118070.59
2462025-07-29117933.39
2472025-07-30117830.15
2482025-07-31115761.13
2492025-08-01113248.73
2502025-08-02112542.74
2512025-08-03114215.73
2522025-08-04115051.85
2532025-08-05114112.95
2542025-08-06115028.83
2552025-08-07117515.49
2562025-08-08116683.79
2572025-08-09116492.51
2582025-08-10119309.37
2592025-08-11118701.84
2602025-08-12120113.18
2612025-08-13123365.63
2622025-08-14118389.79
2632025-08-15117436.96
2642025-08-16117455.68
2652025-08-17117488.6
2662025-08-18116286.76
2672025-08-19112856.19
2682025-08-20114276.0
2692025-08-21112480.3
2702025-08-22116908.68
2712025-08-23115383.87
2722025-08-24113478.0
2732025-08-25110127.74
2742025-08-26111788.01
2752025-08-27111253.21
2762025-08-28112574.85
2772025-08-29108378.32
2782025-08-30108827.93
2792025-08-31108247.95
2802025-09-01109240.55
2812025-09-02111247.94
2822025-09-03111756.41
2832025-09-04110720.79
2842025-09-05110670.02
2852025-09-06110212.6
2862025-09-07111129.61
2872025-09-08112072.57
2882025-09-09111549.32
2892025-09-10113983.97
2902025-09-11115540.0
2912025-09-12116106.03
2922025-09-13115968.35
2932025-09-14115314.13
2942025-09-15115381.08
2952025-09-16116832.56
2962025-09-17116484.4
2972025-09-18117117.99
2982025-09-19115690.55
2992025-09-20115752.4
3002025-09-21115282.27
3012025-09-22112736.59
3022025-09-23112017.21
3032025-09-24113348.17
3042025-09-25109035.72
3052025-09-26109697.29
3062025-09-27109681.16
3072025-09-28112197.67
3082025-09-29114365.07
3092025-09-30114067.71
3102025-10-01118659.97
3112025-10-02120621.32
3122025-10-03122318.4
3132025-10-04122458.56
3142025-10-05123520.79
3152025-10-06124720.09
3162025-10-07121393.95
3172025-10-08123343.25
3182025-10-09121714.51
3192025-10-10112980.28
3202025-10-11110768.89
3212025-10-12115067.98
3222025-10-13115274.03
3232025-10-14113068.0
3242025-10-15110804.12
3252025-10-16108198.0
3262025-10-17106463.3
3272025-10-18107208.91
3282025-10-19108676.78
3292025-10-20110568.06
3302025-10-21108362.27
3312025-10-22107585.98
3322025-10-23110116.03
3332025-10-24111042.13
3342025-10-25111666.21
3352025-10-26114548.09
3362025-10-27114087.06
3372025-10-28112906.75
3382025-10-29110032.13
3392025-10-30108308.18
3402025-10-31109555.27
3412025-11-01110052.25
3422025-11-02110536.01
3432025-11-03106557.98
3442025-11-04101468.15
3452025-11-05103869.0
3462025-11-06101290.5
3472025-11-07103284.27
3482025-11-08102285.57
3492025-11-09104694.95
3502025-11-10105979.38
3512025-11-11103009.35
3522025-11-12101639.01
3532025-11-1399614.54
3542025-11-1494503.96
3552025-11-1595544.94
3562025-11-1694183.97
3572025-11-1792100.6
3582025-11-1892914.46
3592025-11-1991461.6
3602025-11-2086536.88
3612025-11-2185068.88
3622025-11-2284684.0
3632025-11-2386808.28
3642025-11-2488266.2
3652025-11-2587325.01
3662025-11-2690468.84
3672025-11-2791316.7
3682025-11-2890902.7
3692025-11-2990828.06
3702025-11-3090369.51
3712025-12-0186282.36
3722025-12-0291308.05
3732025-12-0393453.84
3742025-12-0492093.54
3752025-12-0589345.29
3762025-12-0689267.97
3772025-12-0790402.29
3782025-12-0890653.86
3792025-12-0992690.0
3802025-12-1092035.99
3812025-12-1192542.0
3822025-12-1290278.0
3832025-12-1390255.32
3842025-12-1488171.61
3852025-12-1586417.5
3862025-12-1687854.01
3872025-12-1786209.77
3882025-12-1885460.02
3892025-12-1988092.65
3902025-12-2088324.0
3912025-12-2188639.95
3922025-12-2288556.77
3932025-12-2387429.32
3942025-12-2487609.03
3952025-12-2587171.68
3962025-12-2687296.01
3972025-12-2787808.0
3982025-12-2887877.29
3992025-12-2987110.78
4002025-12-3088397.5
4012025-12-3187497.94
4022026-01-0188738.34
4032026-01-0289957.99
4042026-01-0390598.02
4052026-01-0491494.0
4062026-01-0593870.06
4072026-01-0693722.01
4082026-01-0791279.73
4092026-01-0891026.0
4102026-01-0990515.45
4112026-01-1090385.54
4122026-01-1190872.01
4132026-01-1291188.09
4142026-01-1395384.23
4152026-01-1496955.16
4162026-01-1595587.65
4172026-01-1695504.0
4182026-01-1795109.99
4192026-01-1893633.53
4202026-01-1992559.66
4212026-01-2088310.6
4222026-01-2189363.71
4232026-01-2289463.5
4242026-01-2389474.93
4252026-01-2489082.17
4262026-01-2586561.94
4272026-01-2688250.01
4282026-01-2789116.96
4292026-01-2889162.4
4302026-01-2984513.2
4312026-01-3084110.99
4322026-01-3178648.0
4332026-02-0176895.53
4342026-02-0278666.85
4352026-02-0375661.49
4362026-02-0472998.0
4372026-02-0562791.0
4382026-02-0670527.7
4392026-02-0769244.74
4402026-02-0870279.33
4412026-02-0970101.99
4422026-02-1068803.65
4432026-02-1167024.93
4442026-02-1266208.0
4452026-02-1368812.0
4462026-02-1469786.96
4472026-02-1568792.0
4482026-02-1668858.13
4492026-02-1767466.7
4502026-02-1866419.79
4512026-02-1966972.5
4522026-02-2067984.42
4532026-02-2167955.78
4542026-02-2267617.98
4552026-02-2364625.78
4562026-02-2464068.33
4572026-02-2567992.68
4582026-02-2667490.51
4592026-02-2765859.94
4602026-02-2866967.85
4612026-03-0165769.0
4622026-03-0268832.01
4632026-03-0368335.99
4642026-03-0472683.26
4652026-03-0570887.6
4662026-03-0668108.24
4672026-03-0767259.62
4682026-03-0865970.56
4692026-03-0968432.17
4702026-03-1069960.83
4712026-03-1170208.0
4722026-03-1270531.56
4732026-03-1370944.33
4742026-03-1471232.02
4752026-03-1572830.01
4762026-03-1674886.47
4772026-03-1773934.11
4782026-03-1871245.02
4792026-03-1969918.3
4802026-03-2070497.01
4812026-03-2168912.02
4822026-03-2267844.94
4832026-03-2370874.23
4842026-03-2470533.49
4852026-03-2571301.53
4862026-03-2668769.02
4872026-03-2766353.34
4882026-03-2866320.15
4892026-03-2965956.94
4902026-03-3066737.18
4912026-03-3168221.85
4922026-04-0168112.35
4932026-04-0266894.48
4942026-04-0366959.99
4952026-04-0467291.73
4962026-04-0569005.0
4972026-04-0668853.61
4982026-04-0771910.2
4992026-04-0871085.99
5002026-04-0971798.01
5012026-04-1072997.88
5022026-04-1173086.0
5032026-04-1270755.35
5042026-04-1374446.0
5052026-04-1474179.04
5062026-04-1574836.31
5072026-04-1675163.09
5082026-04-1777098.01
5092026-04-1875736.82
5102026-04-1973823.14
5112026-04-2075864.86
5122026-04-2176348.58
5132026-04-2278208.52
5142026-04-2378281.32
5152026-04-2477461.8
5162026-04-2577650.72
5172026-04-2678673.83
5182026-04-2777364.42
5192026-04-2876317.99
5202026-04-2975752.88
5212026-04-3076305.78
5222026-05-0178234.05
5232026-05-0278682.31
5242026-05-0378558.89
5252026-05-0479852.37
5262026-05-0580907.72
5272026-05-0681438.1
5282026-05-0780005.38
5292026-05-0880188.82
5302026-05-0980655.96
5312026-05-1082199.99
5322026-05-1181727.06
5332026-05-1280484.72
5342026-05-1379288.26
5352026-05-1481079.39
5362026-05-1579058.51
5372026-05-1678105.45
5382026-05-1777407.59
5392026-05-1876943.98
5402026-05-1976767.48
5412026-05-2077475.99
5422026-05-2177547.62
5432026-05-2275443.91
5442026-05-2376650.0
5452026-05-2476975.99
5462026-05-2577249.07
5472026-05-2675826.1
5482026-05-2774315.98
5492026-05-2873512.56
5502026-05-2973366.77
5512026-05-3073770.69
5522026-05-3173575.17
5532026-06-0171314.42
5542026-06-0266658.35
5552026-06-0364040.0
5562026-06-0463806.02
5572026-06-0561032.0
5582026-06-0660850.48
5592026-06-0763302.73
5602026-06-0863062.98
5612026-06-0961685.8
5622026-06-1061449.46
5632026-06-1163563.42
5642026-06-1263538.43
5652026-06-1364429.99
5662026-06-1465706.62
5672026-06-1566276.8
5682026-06-1665616.64
5692026-06-1764446.04
5702026-06-1862879.01
5712026-06-1963475.2
5722026-06-2064222.99
5732026-06-2163235.63
5742026-06-2263950.61
5752026-06-2362644.86
5762026-06-2460983.13
5772026-06-2559703.65
5782026-06-2660002.53
5792026-06-2759934.84
5802026-06-2859474.01
5812026-06-2960162.73
5822026-06-3058523.93
5832026-07-0159961.45
5842026-07-0261484.02
5852026-07-0362520.22
5862026-07-0463086.45
5872026-07-0563580.44
5882026-07-0664001.84
5892026-07-0763323.27
5902026-07-0862237.7
5912026-07-0963175.25
5922026-07-1064128.49
5932026-07-1163773.04
5942026-07-1263740.32
5952026-07-1362264.94
5962026-07-1464988.64
5972026-07-1564716.63
5982026-07-1663770.6
5992026-07-1763894.0
6002026-07-1864796.36
6012026-07-1964681.78
6022026-07-2065213.05
6032026-07-2166516.18
6042026-07-2266086.61
6052026-07-2365051.23
6062026-07-2464083.32
6072026-07-2564295.61
6082026-07-2665341.07
6092026-07-2763694.43
6102026-07-2863847.12
6112026-07-2963896.14
6122026-07-3064721.9
6132026-07-3162825.9
6142026-08-0162764.2
6152026-08-0263499.49
6162026-08-0363466.51
6172026-08-0464050.51
6182026-08-0564603.03
6192026-08-0664267.3
6202026-08-0764891.61
6212026-08-0864908.72
6222026-08-0964848.69
6232026-08-1063911.88
6242026-08-1163531.75
6252026-08-1263411.72
6262026-08-1363425.35
6272026-08-1462975.19
6282026-08-1563018.75
6292026-08-1662836.66
6302026-08-1764484.18
6312026-08-1864681.33
6322026-08-1969300.01
6332026-08-2073011.87
6342026-08-2178325.54
6352026-08-2277054.44
6362026-08-2377729.36
6372026-08-2478981.59
6382026-08-2578526.8
6392026-08-2679026.18
6402026-08-2780275.34
6412026-08-2877839.19
6422026-08-2978233.93
6432026-08-3077665.14
6442026-08-3178562.74
6452026-09-0177398.69
6462026-09-0277307.36
6472026-09-0381263.99
6482026-09-0479675.12
6492026-09-0579831.57
6502026-09-0680339.13
6512026-09-0779091.97
6522026-09-0878447.11
6532026-09-0978283.98
6542026-09-1076536.55
6552026-09-1177208.55
6562026-09-1277262.85
6572026-09-1376799.85
6582026-09-1478175.01
6592026-09-1575584.17
6602026-09-1676144.99
6612026-09-1776348.74
6622026-09-1880875.04
6632026-09-1981233.91
6642026-09-2081159.64
6652026-09-2186594.94
6662026-09-2286198.05
6672026-09-2384378.31