32 lines
1.5 KiB
Markdown
32 lines
1.5 KiB
Markdown
Data layout and formats
|
|
|
|
This section describes the `_data/` directory and the important files used by the scripts.
|
|
|
|
Important files
|
|
|
|
- `_data/market_data.db` — SQLite database that stores candle tables. Tables are typically named `<COIN>_<INTERVAL>` (e.g., `BTC_1m`, `ETH_5m`).
|
|
- `_data/coin_precision.json` — Mapping of coin names to their size precision (created by `list_coins.py`).
|
|
- `_data/current_prices.json` — Latest market prices that `market.py` writes.
|
|
- `_data/fetcher_status.json` — Last run metadata from `data_fetcher.py`.
|
|
- `_data/market_cap_data.json` — Market cap summary saved by `market_cap_fetcher.py`.
|
|
- `_data/strategies.json` — Configuration for strategies (enabled flag, parameters).
|
|
- `_data/strategy_status_<name>.json` — Per-strategy runtime status including last signal and price.
|
|
- `_data/executor_managed_positions.json` — Which strategy is currently managing which live position (used by `trade_executor`).
|
|
|
|
Candle schema
|
|
|
|
Each candle table contains columns similar to:
|
|
- `timestamp_ms` (INTEGER) — milliseconds since epoch
|
|
- `open`, `high`, `low`, `close` (FLOAT)
|
|
- `volume` (FLOAT)
|
|
- `number_of_trades` (INTEGER)
|
|
|
|
Trade logs
|
|
|
|
- Persistent trade history is stored in `_logs/trade_history.csv` with the following columns: `timestamp_utc`, `strategy`, `coin`, `action`, `price`, `size`, `signal`, `pnl`.
|
|
|
|
Backups and maintenance
|
|
|
|
- Periodically back up `_data/market_data.db`. The WAL and SHM files are also present when SQLite uses WAL mode.
|
|
- Keep JSON config/state files under version control only if they contain no secrets.
|