spicy-regime

Rate-of-change regime identification for crypto-derivatives trading — the signal is the acceleration of the ROC, not the ROC itself.

Phase 1 · Diagnostic Run (6 / 20 symbols) 384 Tests Executed 100% Success Rate Not Yet Fee-Adjusted / Validated

Core Concept

Regime = Rate of Change of the ROC

Instead of classifying market regimes from levels (high/low volume) or first-order changes (volume up 20%), this model identifies regimes by analyzing the second-order change: whether the rate of change itself is accelerating, steady, or decelerating.

"If volume spikes differently in this 1-hour period compared to last hour, use that as the regime signal — hour 1→2 ROC is 2×, hour 2→3 ROC is also 2× ⇒ momentum is steady; if the ROC slows to 1.2× ⇒ momentum is decaying."

Methodology

The Model Pipeline

Raw data (15m/1h klines) Anchor-based aggregation (hour / session / day / week) Chunk series X_k (price, volume, OI per anchor) ROC calculation: R_k = (X_k − X_k₋₁) / X_k₋₁ Acceleration signal: A_k = compare(R_k, reference) Regime labeling: S_k = discretize(A_k) Trading signals: entry / exit / filtering

Anchors Tested

  • Hourly (UTC 00:00, 01:00…) — 1h chunks
  • Session (Tokyo 00–09, London 09–17, NY 13–22 UTC) — variable chunks
  • Daily (00:00 UTC) — 24h chunks
  • Weekly (Monday 00:00 UTC) — 7d chunks

ROC Methods

  • Simple %: (Xt − Xt-1) / Xt-1
  • Log: ln(Xt / Xt-1)
  • Smoothed: ROC then SMA/EMA
  • Z-scored: (ROC − mean) / std

Acceleration Signals

  • Consecutive ratio: Rt / Rt-1 (the "2×, 2×, 1.2×" example)
  • Consecutive difference: Rt − Rt-1
  • Z-scored ROC: how unusual today's ROC is

Regime Labels

  • 4-quadrant: (price ROC sign) × (volume ROC magnitude)
  • 9-grid: (price ROC tercile) × (volume ROC tercile)

Analysis Performed

Data Collection

  • Live 180-day (or since-listing, if shorter) 15m and 1h klines for the current top 20 Bybit USDT perpetuals by 24h volume (fetched 2026-09-10)
  • Separated into pure cohorts via is_stock_perp():
    • Crypto-native (17): BTC, ETH, SOL, ZEC, XRP, HYPE, NEAR, IOST, DOGE, PUMPFUN, VVV, PONS, XAU, USELESS, SNDK, SUI, ENA
    • Stock-ETF (3): AAPL, SKHYNIX, SOXL

Evaluation Protocol (as run so far)

  • Per-regime analysis: mean, median, win rate, n for returns over the current anchor period
  • Baseline comparison: best-regime mean return vs. unconditional mean return
  • Not yet applied: fee adjustment, walk-forward splits, Monte Carlo bootstrap, cluster-vs-spike overfit test — all designed in parameter-matrix.md §8 but not yet implemented in the evaluation script

Key Findings

Read this before the numbers below: this is a 6-of-20-symbol diagnostic smoke test of the bug-fixed pipeline — not a validated result. Returns are gross (no fees), in-sample (no walk-forward split), and several cells have very small n. Treat everything here as "the pipeline runs correctly," not "this is an edge."

Phase 1 Diagnostic Run — BTCUSDT, DOGEUSDT, ENAUSDT, AAPLUSDT, SKHYNIXUSDT, SOXLUSDT

384/384 test cells executed successfully (100%) on the first run of the bug-fixed pipeline. Average improvement (best-regime mean return − unconditional mean), averaged across all parameter combinations per anchor:

+0.0007
Hourly
+0.0044
Session
+0.0181
Daily
+0.0842
Weekly

The weekly anchor shows the largest average improvement, but weekly cells only have 6–24 periods per symbol — far too few to distinguish real edge from noise.

Top Performing Combinations (raw, unvalidated)

RankImprovementSymbolAnchorROCAccelRegimeVol ThreshPeriods
1+0.7948ENAUSDTWeeklysimpleratiogridN/A16
2+0.7948ENAUSDTWeeklysimplezscoregridN/A16
3+0.7844ENAUSDTWeeklyzscoreratiogridN/A15
4+0.7844ENAUSDTWeeklyzscorezscoregridN/A15
5+0.1692ENAUSDTWeeklysimpleratioquadrant1.2524

Note: the leaderboard is dominated by ENAUSDT weekly-grid cells with n=15–16 — a classic name-concentrated, small-sample result that parameter-matrix.md explicitly warns about. Needs the full 20-symbol run plus overfit testing before it means anything.

Honest Caveats

  • This run covers 6 of 20 symbols as a pipeline smoke test, not the full matrix
  • Returns are gross, not fee-adjusted (0.055% taker × 2 + slippage per the protocol)
  • No walk-forward split has been applied — all numbers are in-sample
  • Weekly-anchor cells have very small n (as low as 3–6 periods for some cells)

Repository Structure

spicy-regime/ ├── README.md # This file (GitHub) ├── SITE.md # This website content ├── docs/ │ ├── methodology.md # Formal model definition │ ├── parameter-matrix.md # Complete parameter test matrix │ ├── data-sources.md # Bybit API endpoints and limits │ └── decisions.md # Decision log tracking all changes ├── src/ │ ├── regime_model.py # Core implementation: data fetching, ROC calculations │ └── evaluate_phase1.py # Evaluation harness ├── scripts/ │ ├── get_top_symbols.py # Fetch top 20 Bybit symbols by volume │ ├── fetch_data.py # Download 15m/1h klines for all symbols │ ├── test_fetch.py # Test data fetching functionality │ └── test_implementation.py # Test regime calculations ├── data/ # Fetched klines data (15m/1h parquet files) ├── results/ # Analysis outputs (JSON + markdown reports) └── run_phase1_evaluation.py # Main evaluation script

How to Run

1. Fetch Data

python scripts/get_top_symbols.py # Get top 20 symbols python scripts/fetch_data.py # Download 180 days of klines

2. Run Evaluation

python run_phase1_evaluation.py # Runs the 6-symbol diagnostic matrix

Extending this to the full 20-symbol universe, plus fee adjustment, walk-forward splits, and overfit testing, is the next step — see Roadmap below.

Implementation Details

  • Data fetching: Bybit V5 public REST API (no keys required)
  • Calculations: Pandas/Numpy for vectorized operations
  • Storage: Parquet format for efficient I/O
  • Evaluation: per-regime statistics computed so far; walk-forward validation, fee adjustment, and bootstrap/overfit testing are designed but not yet implemented

Roadmap

Based on the diagnostic run, recommended next steps:

  1. Run the full 20-symbol universe (currently only 6/20 tested)
  2. Add fee adjustment (0.055% taker × 2 + slippage) to all return figures
  3. Add walk-forward train/valid/test splits — all current numbers are in-sample
  4. Add the Monte Carlo bootstrap and cluster-vs-spike overfit tests before treating any combination as a real edge
  5. Report median alongside mean for every regime cell (name-concentration check)
  6. Add Open Interest analysis once sufficient historical data is accumulated

References

The methodology builds on established approaches from:

  • Bybit perpetual backtesting skill (walk-forward validation, cohort separation)
  • Technical analysis frameworks (ROC, momentum indicators)
  • Regime-switching models in financial econometrics
  • An existing CVD×drift aggression quadrant model