Lab · ML Experiments

ML — Pattern Discovery

Inverted workflow: find conditional edges in BTC data first, build strategies second.
55 experiments

Price-vs-RSI / Volume divergences — fwd-return scan

Dropped
2026-05-24 divergencersivolumepattern_scan
Hypothesis
Classic price/RSI and price/volume divergences (regular + hidden, bull + bear) predict directional fwd returns at 4h and 24h horizons on BTC. Test all 8 pattern types across 1h and 4h timeframes, walk-forward + permutation baseline.
Verdict
**DROP** — strongest pattern only +52.8 bps signed (`hid_bull_vol` @ 4h/24h) with permutation p=0.369. Divergences as defined here don't carry edge on BTC walk-forward. Folklore not confirmed.
best_p_value
+0.3693
best_pattern
hid_bull_vol @ 4h/24h
best_signed_bps
+52.8155
best_total_signals
160
best_windows_under_5pct_p
1

Price-vs-RSI / Volume divergences — fwd-return scan

2026-05-24 · status: dropped · 1.7s

Hypothesis: Classic price/RSI and price/volume divergences (regular + hidden, bull + bear) predict directional fwd returns at 4h and 24h horizons on BTC. Test all 8 pattern types across 1h and 4h timeframes, walk-forward + permutation baseline.

Verdict: DROP — strongest pattern only +52.8 bps signed (hid_bull_vol @ 4h/24h) with permutation p=0.369. Divergences as defined here don't carry edge on BTC walk-forward. Folklore not confirmed.

Key metrics

metric value
best_pattern hid_bull_vol @ 4h/24h
best_signed_bps +52.8155
best_p_value +0.3693
best_windows_under_5pct_p 1
best_total_signals 160

Approach

  1. Load 1m BTC futures candles, resample to the test timeframe.
  2. Compute 14-period RSI on close.
  3. Identify 5-bar swing pivots (k=5 → 11-bar look-around, confirmation delay = 5 bars so signals fire at pivot_index + 5, no lookahead).
  4. For each new confirmed pivot, compare it to the prior pivot of the same kind within the last 50 bars. Stamp the 8 divergence patterns.
  5. Walk-forward (12mo train / 3mo test, 24h embargo). On each test window, compute mean signed fwd return at 4h and 24h horizons, then run 200 mask-permutations to derive a per-window empirical p-value.
  6. Pool across windows: mean signed return, mean p, count of windows with individual p<0.05.

Per-timeframe scan

Timeframe: 1h (55,826 bars)

Signal counts (full sample): reg_bear_rsi=375, reg_bull_rsi=330, hid_bear_rsi=326, hid_bull_rsi=395, reg_bear_vol=665, reg_bull_vol=577, hid_bear_vol=616, hid_bull_vol=672

Walk-forward windows: 21

Timeframe: 4h (13,958 bars)

Signal counts (full sample): reg_bear_rsi=108, reg_bull_rsi=69, hid_bear_rsi=80, hid_bull_rsi=95, reg_bear_vol=181, reg_bull_vol=148, hid_bear_vol=169, hid_bull_vol=203

Walk-forward windows: 21

Pooled OOS results

timeframe horizon pattern direction n_windows total_signals mean_signed_bps median_signed_bps mean_p_value p_under_5pct
1h 24h reg_bull_vol long 21 490 19.46 1.3 0.431 4
1h 24h hid_bull_vol long 21 531 14.81 28.28 0.417 0
1h 24h reg_bull_rsi long 21 299 7.59 10.94 0.492 0
1h 24h hid_bull_rsi long 21 322 -0.68 -6.26 0.497 1
1h 24h reg_bear_vol short 21 550 -0.77 0.39 0.472 0
1h 24h reg_bear_rsi short 21 306 -17.09 -21.75 0.555 1
1h 24h hid_bear_rsi short 21 279 -23.26 -26.55 0.555 0
1h 24h hid_bear_vol short 21 513 -42.66 -46.69 0.686 0
1h 4h reg_bear_vol short 21 550 6.11 7.37 0.405 0
1h 4h hid_bull_vol long 21 531 5.76 14.81 0.415 4
1h 4h reg_bull_rsi long 21 299 4.89 -6.54 0.553 3
1h 4h reg_bull_vol long 21 490 1.7 -2.83 0.543 2
1h 4h reg_bear_rsi short 21 306 0.52 2.31 0.47 2
1h 4h hid_bull_rsi long 21 322 -9.48 -3.44 0.59 1
1h 4h hid_bear_vol short 21 513 -12.29 -19.94 0.653 0
1h 4h hid_bear_rsi short 21 279 -15.51 -11.64 0.631 0
4h 24h hid_bull_vol long 21 160 52.82 38 0.369 1
4h 24h hid_bull_rsi long 20 68 30.67 -27.76 0.555 1
4h 24h reg_bull_rsi long 20 60 -8.69 4.44 0.544 1
4h 24h reg_bear_vol short 21 145 -12.68 -32.94 0.505 0
4h 24h reg_bull_vol long 21 134 -15.58 -0.81 0.539 0
4h 24h hid_bear_rsi short 16 70 -33.31 -30.82 0.546 0
4h 24h hid_bear_vol short 21 150 -47.56 -39.91 0.633 0
4h 24h reg_bear_rsi short 20 88 -56.64 -47.6 0.578 0
4h 4h hid_bull_rsi long 20 68 23.41 -9.19 0.541 2
4h 4h hid_bull_vol long 21 160 17.7 8.87 0.449 4
4h 4h reg_bull_vol long 21 134 14.12 11.25 0.427 0
4h 4h hid_bear_vol short 21 150 7.19 12.33 0.448 1
4h 4h reg_bear_vol short 21 145 -0.4 -0.3 0.498 1
4h 4h reg_bull_rsi long 20 60 -7.15 -5.23 0.552 0
4h 4h reg_bear_rsi short 20 88 -13.82 3.89 0.535 1
4h 4h hid_bear_rsi short 16 70 -24.71 -27.14 0.558 0

barchart 1h 24h

barchart 4h 24h