Download Kraken OHLCV candles to CSV
An OHLCV row stores the open, high, low, close and base-asset volume for an interval. Use closed candles in a historical test. Kraken’s OHLC response appends the still-forming interval, so its last row can change between requests. Kraken OHLC reference
Export a new file
Download kraken-ohlcv.py and run this command in the download directory with Python 3.
python kraken-ohlcv.py --pair XBTUSD --interval 1440 --output btc-usd-1d.csv
XBTUSD requests BTC/USD and 1440 is one day in minutes. Use ETHUSD for ETH/USD or 240 for four-hour candles. The script drops the last API row, checks price bounds, volume and time order, then creates a new UTF-8 file. Without --output it writes CSV to standard output.
The columns are time_utc,open,high,low,close,volume_base,trades. The timestamp is the start of the interval. A row stamped December 2, 2026 at 00:00 UTC covers that UTC day. The day’s close is available after the day ends.
Verify the date range
The request on December 3, 2026 returned 720 closed daily rows from December 13, 2024 through December 2, 2026. The REST endpoint serves a bounded recent window. The since cursor helps obtain new rows, and Kraken provides an archive for older periods. Store each received closed candle by pair, interval and UTC time. Kraken OHLCVT downloads
Check time spacing before calculating returns. A missing record and a known zero-volume bar carry different information. Flag gaps in OHLCV.