record_data
Capture market data into a .floxlog tape. Supports live recording via CLI or historical backfill using ccxt to fetch OHLCV klines or trades.
Instructions
Capture market data into a .floxlog tape. Wraps the canonical recording paths — for mode=live shells out to the flox tape record CLI; for mode=historical shells out to scripts/backfill_to_tape.py which uses ccxt's fetch_ohlcv / fetch_trades. Use this when the user asks to 'record some BTC data' / 'pull a month of klines for backtest' / 'tape the last hour of trades'. The result is a .floxlog directory drivable by BacktestRunner.run_tape.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | `historical` = ccxt backfill of past data. `live` = capture from now onwards via `flox tape record`. | |
| exchange | Yes | ccxt exchange id (bitget, binance, bybit, ...). | |
| symbol | Yes | Symbol in the exchange's spelling (BTC/USDT, BTCUSDT — both accepted). | |
| out_path | Yes | Output `.floxlog` directory (will be created if missing). | |
| data_type | No | Historical mode only. `klines` (1m bars by default) or `trades` (per-print). Trades have higher fidelity but are limited by what each exchange exposes. | |
| from_dt | No | Historical mode. Start datetime — ISO (2026-04-01) or unix-ms. | |
| to_dt | No | Historical mode. End datetime — ISO or unix-ms. | |
| duration | No | Live mode. Recording duration (`1h`, `30m`, `2d`). Omit for an open-ended recording (Ctrl+C to stop). | |
| max_records | No | Historical mode. Refuse to start if estimated row count exceeds this. Default 1_000_000. |