Datasets:

File size: 7,133 Bytes
a0e0bc8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
---

license: mit
task_categories:
- time-series-forecasting
language:
- en
tags:
- tsfile
- timeseries
- time-series
pretty_name: Crypto Trading Bot Data (TsFile)
configs:
- config_name: default
  data_files:
  - split: btc_dominance
    path: btc_dominance.tsfile
  - split: fear_greed
    path: fear_greed.tsfile
  - split: features_d
    path: features_d.tsfile
  - split: funding_rates
    path: funding_rates.tsfile
  - split: klines_1h
    path: klines_1h.tsfile
  - split: macro_indicators
    path: macro_indicators.tsfile
  - split: ohlcv_1
    path: ohlcv_1.tsfile
  - split: ohlcv_1m_1
    path: ohlcv_1m_1.tsfile
  - split: ohlcv_1m_10
    path: ohlcv_1m_10.tsfile
  - split: ohlcv_1m_11
    path: ohlcv_1m_11.tsfile
  - split: ohlcv_1m_12
    path: ohlcv_1m_12.tsfile
  - split: ohlcv_1m_13
    path: ohlcv_1m_13.tsfile
  - split: ohlcv_1m_14
    path: ohlcv_1m_14.tsfile
  - split: ohlcv_1m_15
    path: ohlcv_1m_15.tsfile
  - split: ohlcv_1m_16
    path: ohlcv_1m_16.tsfile
  - split: ohlcv_1m_17
    path: ohlcv_1m_17.tsfile
  - split: ohlcv_1m_18
    path: ohlcv_1m_18.tsfile
  - split: ohlcv_1m_19
    path: ohlcv_1m_19.tsfile
  - split: ohlcv_1m_2
    path: ohlcv_1m_2.tsfile
  - split: ohlcv_1m_20
    path: ohlcv_1m_20.tsfile
  - split: ohlcv_1m_21
    path: ohlcv_1m_21.tsfile
  - split: ohlcv_1m_22
    path: ohlcv_1m_22.tsfile
  - split: ohlcv_1m_23
    path: ohlcv_1m_23.tsfile
  - split: ohlcv_1m_24
    path: ohlcv_1m_24.tsfile
  - split: ohlcv_1m_25
    path: ohlcv_1m_25.tsfile
  - split: ohlcv_1m_3
    path: ohlcv_1m_3.tsfile
  - split: ohlcv_1m_4
    path: ohlcv_1m_4.tsfile
  - split: ohlcv_1m_5
    path: ohlcv_1m_5.tsfile
  - split: ohlcv_1m_6
    path: ohlcv_1m_6.tsfile
  - split: ohlcv_1m_7
    path: ohlcv_1m_7.tsfile
  - split: ohlcv_1m_8
    path: ohlcv_1m_8.tsfile
  - split: ohlcv_1m_9
    path: ohlcv_1m_9.tsfile
  - split: ohlcv_2
    path: ohlcv_2.tsfile
  - split: ohlcv_3
    path: ohlcv_3.tsfile
  - split: ohlcv_4
    path: ohlcv_4.tsfile
  - split: ohlcv_5
    path: ohlcv_5.tsfile
  - split: open_interest
    path: open_interest.tsfile
---


# Crypto Trading Bot Data (TsFile)

Apache TsFile version of [`jponfiru/crypto-trading-bot-data`](https://huggingface.co/datasets/jponfiru/crypto-trading-bot-data).

## Overview

OHLCV market data and derived features for a Binance spot trading bot: 1-minute klines for the top-20 USDT pairs (2024 onward), 5-minute klines for 2026, 1-hour klines, funding rates, open interest, macro indicators, the Fear & Greed index, BTC dominance, and a labelled feature table for the project's Model D.

- **TsFile shards:** 37 (1054.2 MB total, 29,706,465 rows across 9 table(s)).
  - `btc_dominance` — 6 rows in 1 shard(s), 2026-05-18 01:06:09.359000 → 2026-05-21 12:34:43.211000 (UTC)
  - `fear_greed` — 3,028 rows in 1 shard(s), 2018-02-01 00:00:00 → 2026-05-21 00:00:00 (UTC)
  - `features_d` — 219,043 rows in 1 shard(s), 2024-01-09 08:00:00 → 2026-05-10 14:00:00 (UTC)
  - `funding_rates` — 57,360 rows in 1 shard(s), 2024-01-01 00:00:00 → 2026-05-21 12:00:00 (UTC)
  - `klines_1h` — 383,190 rows in 1 shard(s), 2024-01-01 00:00:00 → 2026-05-11 15:00:00 (UTC)
  - `macro_indicators` — 54 rows in 1 shard(s), 2026-05-11 04:00:00 → 2026-05-21 07:00:00 (UTC)
  - `ohlcv` — 4,610,042 rows in 5 shard(s), 2024-01-01 00:00:00 → 2026-05-14 03:00:00 (UTC)
  - `ohlcv_1m` — 24,432,100 rows in 25 shard(s), 2024-01-01 00:00:00 → 2026-05-21 12:34:00 (UTC)
  - `open_interest` — 1,642 rows in 1 shard(s), 2026-05-18 02:00:00 → 2026-05-21 12:00:00 (UTC)

## Conversion notes

- The source stores its series inside two SQLite databases; TsFile cannot read SQLite, so every table is streamed out of its database into a TsFile table of its own. Table list, row counts and skipped tables are recorded in `conversion_summary.json`.
- Tables with a `pair` (or `symbol`) column — `ohlcv_1m`, `ohlcv`, `klines_1h`, `funding_rates`, `open_interest`, `macro_indicators` and `features_d` — declare it as the TAG, so each instrument is one TsFile device with its own timeline; `fear_greed` and `btc_dominance` are single-device tables.
- Time = the source timestamp column at millisecond precision: `ts_ms` is already epoch milliseconds, `ts` is epoch seconds, and `ohlcv.timestamp` is an ISO-8601 string.
- No column and no row is dropped. `ohlcv_1m` (2024 onward) and `ohlcv` (2026) overlap; both are kept as separate tables rather than merged, and no duplicate key is removed because the two tables cover different timeframes.
- Not converted: `download_state (data_2026.db), download_progress (data_extended.db)` — bookkeeping tables recording the crawler's own progress, not time series.
- Not converted: `features_extended.csv` — 2.1 GB CSV of event features that was not downloaded for this conversion; the compact `features_d.csv` subset (219,043 rows) is included instead.
- The TsFiles are written with the `zstd` compressor. The Apache TsFile **Java** SDK reads every compressor, but the **Python** SDK (`pip install tsfile`) implements only `UNCOMPRESSED`, `SNAPPY`, `GZIP` and `LZ4`; opening these files with it returns no rows. Read them with the Java SDK, as shown below.

## Usage

> **Read this dataset with the Java SDK.** It is written with the `zstd` compressor. The Apache TsFile Java SDK reads every compressor, but the Python SDK (`pip install tsfile`) implements only `UNCOMPRESSED`, `SNAPPY`, `GZIP` and `LZ4`; opening this file with it yields no rows.

Read a converted file with the Apache TsFile Java SDK (`org.apache.tsfile:tsfile`):

```java

import org.apache.tsfile.file.metadata.IDeviceID;

import org.apache.tsfile.read.TsFileReader;

import org.apache.tsfile.read.TsFileSequenceReader;

import org.apache.tsfile.read.common.Path;

import org.apache.tsfile.read.expression.QueryExpression;

import org.apache.tsfile.read.query.dataset.QueryDataSet;

import org.apache.tsfile.write.schema.MeasurementSchema;



import java.util.ArrayList;

import java.util.List;



String path = "btc_dominance.tsfile";

try (TsFileReader reader = new TsFileReader(new TsFileSequenceReader(path))) {

    for (String deviceId : reader.getAllDeviceIds()) {

        IDeviceID device = IDeviceID.Factory.DEFAULT_FACTORY.create(deviceId);

        List<Path> paths = new ArrayList<>();

        for (MeasurementSchema schema : reader.getMeasurement(device)) {

            String name = schema.getMeasurementName();

            if (name != null && !name.isEmpty() && !name.equalsIgnoreCase("Time")) {

                paths.add(new Path(device, name, true));

            }

        }

        QueryDataSet dataSet = reader.query(QueryExpression.create(paths, null));

        while (dataSet.hasNext()) {

            System.out.println(dataSet.next());

        }

    }

}

```

## Source & license

- Original dataset: [`jponfiru/crypto-trading-bot-data`](https://huggingface.co/datasets/jponfiru/crypto-trading-bot-data)
- License: mit (as declared by the original dataset).