Your Regime Backtest Is Probably Cheating

To backtest "go risk-off in a bear regime," you need to know what the regime was on each past day. The trap: most historical regime labels are drawn after the fact, with full knowledge of what came next. That's lookahead bias, and it quietly inflates every backtest built on it.

The /api/v1/quant/timeline endpoint gives you a daily market-regime label from 2019 to now that doesn't cheat: it's produced by the same model that serves live, with no hindsight relabeling.

A Daily Label, 2019 to Now

The timeline is a daily series of the market regime label, covering every major chapter of the modern crypto market:

Every day is labeled by the final trained model run over its full training history, and the whole series is regenerated on every retrain so it always reflects the current model — not a frozen legacy one.

Is This Lookahead-Biased?

No — and that's the entire point. Two properties make it honest:

So a strategy you test against the timeline sees the same kind of label it will see live. That's the difference between a backtest that survives contact with production and one that doesn't.

Pulling the Timeline

Filter from any start date with the start parameter:

curl -H "X-API-Key: cdk_live_your_key" \
  "https://cryptodataapi.com/api/v1/quant/timeline?start=2022-01-01"
{
  "model_version": "fv2", "count": 1276,
  "entries": [
    {"date": "2022-05-09", "regime": "bear"},
    {"date": "2022-11-08", "regime": "vol_spike"},
    {"date": "2024-01-11", "regime": "bull"}
  ],
  "note": "Daily majority label from the trained model over its full training history"
}

The FTX week (2022-11-08) lands in vol_spike and the ETF approval (2024-01-11) in bull — exactly what you'd want the labels to say.

Timeline vs the Parquet Regime History

Two products, two jobs:

/quant/timelineRegime-history Parquet
ShapeDaily majority labelHourly probability distributions
Range2019 → now2020 → now
DeliveryJSON via API, date-filterableBulk Parquet download
Best forQuick joins, agent lookups, label backtestsHeavy quantitative backtests

Use the timeline when you want "what regime was it that day?" in JSON; use the Parquet history when you need the full hourly probability matrix.

Which Regimes Are in the Vocabulary?

The timeline uses the same six-state market vocabulary as every other quant endpoint, so a label means the same thing live and historically:

Raw HMM states map many-to-one onto these labels — the labels are the API contract. Pull the canonical list any time from /quant/regimes.

How to Backtest With the Timeline

import httpx, pandas as pd
tl = httpx.get("https://cryptodataapi.com/api/v1/quant/timeline?start=2020-01-01",
               headers={"X-API-Key": "cdk_live_your_key"}).json()["entries"]
reg = pd.DataFrame(tl)
reg["date"] = pd.to_datetime(reg["date"])

# join the daily regime onto your OHLC and test a regime-gated rule
df = ohlc.merge(reg, on="date", how="left")
df["in_market"] = df["regime"].isin(["bull", "range"])

Backtest on labels you'll actually get in production, not hindsight-perfect ones.