quantlab.dataset.spot.SpotKlineDataset#
- class quantlab.dataset.spot.SpotKlineDataset(dataset_config)[source]#
Bases:
RawMarketDatasetBinance spot kline dataset built from monthly CSV files.
The raw directory holds one header-less CSV per symbol and month, named
<SYMBOL>-...csv. The column names come fromBinanceCSVHeaders.SPOTand the symbol comes from the file name. Columns keep Binance’s Title-Case spelling (Open,High, …);COLUMN_MAPrenames them to the shared lowercase names into_kunquantand in a merge.- Parameters:
- dataset_configDatasetConfig
Paths (raw CSV directory, Zarr store, Nautilus catalog), market, frequency and date range of the dataset.
Examples
>>> config = DatasetConfig( ... raw_data_dir_path="downloads/crypto_spot/1d/klines", ... zarr_file_path="data/crypto_spot/1d/spot.zarr", ... market="crypto_spot", ... frequency="1d", ... ) >>> SpotKlineDataset(config).from_raw_data().save() >>> panel = SpotKlineDataset(config).panel("2024-01-01", "2024-12-31")
- COLUMN_MAP = {'Close': 'close', 'High': 'high', 'Low': 'low', 'Open': 'open', 'Quote asset volume': 'amount', 'Volume': 'volume'}#
Quote asset volume(traded value in the quote currency) becomesamountand the OHLCV columns are lowercased.