---
title: "Days since decline (BTC) — counter with a required definition"
method: GET
path: "/api/v1/days-since-decline"
tags: ["History"]
---

# Days since decline (BTC) — counter with a required definition

`GET /api/v1/days-since-decline`

## Request

- Base URL: `https://tradingstrategies.work`
- URL: `https://tradingstrategies.work/api/v1/days-since-decline`
- Auth: HTTP bearer

How many days since Bitcoin last fell by X %? mode from_ath (below the running all-time high), rolling_window (within lookback_days, incl. that day) or from_local_peak (below the most recent confirmed local high: highest close of 90 days, not exceeded for 14). Reset day = close at or below reference × (1 − threshold_pct/100); counter = calendar days since the last reset day; consecutive reset days form one episode. Prefix-invariant. Computed on the full daily history for every tier; reference.price is withheld before the deliverable-close boundary. BTC only. MCP: arena_get_days_since_decline. A counter, not a signal.

## Query parameters

- `mode` 'from_ath' | 'rolling_window' | 'from_local_peak', required
- `threshold_pct` number, required
- `lookback_days` integer
- `history_days` integer

## Response `200`

Container: days_since_decline (value_days, mode, threshold_pct, lookback_days, reference, last_reset, resets_in_history, history_from), episodes[], optional daily[], definition, note, provenance.

- object

## Other responses

- `400`: Invalid input — fehlt Pflichtfeld oder Wert außerhalb des erlaubten Bereichs.
- `401`: Unauthenticated — kein gültiger Bearer-Token im Authorization-Header.
- `403`: Tier-Insufficient — Endpoint braucht höheren API-Tier. Response enthält upgrade_url.
- `404`: Not-Found — Resource existiert nicht oder gehört nicht dem aktuellen User.
- `429`: Rate-Limit überschritten — Tier-Quota (hourly/daily) oder Per-Endpoint-Quota erreicht. Retry-After-Header gesetzt.
- `500`: Internal Error.
- `503`: Upstream-Failure — Datenquelle nicht erreichbar (Binance, EODHD, etc.).

---

[API](https://skmtc.dev/tradingstrategies/apis/backtesting-arena-public-api.md) · [All operations](https://skmtc.dev/tradingstrategies/apis/backtesting-arena-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tradingstrategies/apis/backtesting-arena-public-api/revisions/f82e8d6eecd7?raw)
