Backtest with historical OHLCV
A backtest needs clean, dense candles over a long window. Pull historical OHLCV by interval and count, page through the window, and cache it — the reads are cheap C1 so the cost of a full backtest is dominated by your compute, not the API.
- A live API key
- The token id, interval and date window you want to test
1Pull the historical window
Request the id, interval and limit for each page of history. OHLCV is a C1 read, so pulling a long window stays cheap.
curl "https://api.1st-node.com/v1/market/ohlcv?id=btc&interval=1h&limit=168" \ -H "Authorization: Bearer sk_live_..."
2Read and normalize the candles
Each row is timestamp, open, high, low, close and volume. Sort by timestamp and check for gaps before you run the strategy over the series.
> { "candles": [
> [1712000000, 68120.0, 68540.2, 67980.1, 68410.5, 1204.7] ] }3Cache once, iterate many times
Historical candles are immutable, so pull the window once and cache it locally. A tuning loop then reruns over cached data without spending credits on every pass.
Preguntas frecuentes
How do I cover a multi-month window?
Page the OHLCV endpoint with interval and limit, walking the window in batches. Concatenate the pages in timestamp order into one series.
Will repeated backtests burn credits?
Only the initial pull. OHLCV is a cheap C1 read and historical candles never change, so cache the series and rerun your strategy for free.
Sigue leyendo
Recarga, obtén tu clave y publica.
Autoservicio. Paga en cripto o con tarjeta. Medido por créditos: las primitivas pesadas cuestan más, las simples son baratas.
Obtener clave API