🔮Madjik docs

Backtesting

Point-in-time history and how to test without look-ahead bias.

Use live history for honest tests

Add live_only=true to GET /v1/metrics/{id}/timeseries or GET /v1/export/history. You then receive only points that were computed live at the time, from the inputs available then, and not edited afterwards. That series is point-in-time safe. It starts when the metric went live, so it is shorter than the full history.

What the provenance labels mean for a backtest

ProvenanceSafe for a backtest?Why
liveYesComputed at the time with the inputs available then.
backfill_recomputedWith careHistory recomputed with today's definition: it can embed hindsight in the formula, and inputs that are later revised (for example macro series) are the revised ones.
backfill_approximateWith careReconstructed from coarser inputs; a declared approximation.
backfill_model_retroNoAI retrodiction under a blind protocol; hindsight leakage cannot be excluded.
forecastNoA projection, not an observation.

Practical rules

  • Lag your signal by one bar: a value stamped t is available to you only after t.
  • Mind definition versions: GET /v1/metrics/{id}/definition lists when the definition changed; do not treat a series as homogeneous across a version change.
  • Skip STALE periods: a metric with missing inputs publishes nothing rather than a filled value, so gaps are real gaps (Data quality).
  • Include costs and slippage; metric values are indicators, not executable prices.
curl -H "X-API-Key: YOUR_API_KEY" \
  "https://api.madjik.io/v1/metrics/M10004/timeseries?live_only=true&interval=1h&start=2026-09-01T00:00:00Z"

Not investment advice. Past values of an indicator do not indicate future results.