再現手順ガイド
このページは、同じ結果を再現するための実行順序をまとめた実務ガイドです。
1. 環境セットアップ
cd <repo-root>
uv python install 3.14
uv sync --extra dev
確認:
uv run python -V
uv run atc --help
2. データ取り込み
uv run atc ingest historical \
--symbol ETH_JPY \
--start 2022-01-01 \
--end 2026-02-11
仕様:
- 既存rawファイルがある日は再ダウンロードをスキップ
- ただしCSV検証とCanonical化は実行
3. 特徴量キャッシュ(Rust)
uv run atc features cache \
--symbol ETH_JPY \
--start 2022-01-01 \
--end 2026-02-11 \
--feature-backend rust \
--workers 4
出力:
data/derived/features/cache/...parquet- manifest JSON(events/rows/workers など)
4. Hold10 Softmax(stateful)学習
uv run atc ml train-hold10-softmax \
--symbol ETH_JPY \
--start 2022-01-01 \
--end 2025-09-30 \
--horizon-sec 600 \
--label-mode stateful \
--switch-cost-bps 4 \
--short-switch-extra-bps 8 \
--switch-hysteresis-bps 1 \
--class-weight-mode inverse_freq \
--feature-backend rust \
--compute-backend auto \
--compute-device auto \
--batch-size 8192 \
--workers 4 \
--progress-every 1
5. バックテスト(公平条件)
10ETH固定保有との比較を公平にするため、次を揃えます。
initial-position-eth=10benchmark-hold-eth=10target-abs-qty-eth=10max-abs-position-eth=10
uv run atc backtest \
--symbol ETH_JPY \
--start 2026-01-01 \
--end 2026-02-11 \
--strategy ml_hold10_softmax_overlay_derisk_only_aggressive \
--initial-position-eth 10 \
--benchmark-hold-eth 10 \
--target-abs-qty-eth 10 \
--max-abs-position-eth 10 \
--order-latency-sec 0.3 \
--min-order-interval-sec 300 \
--plot --plot-format both --plot-interval 5m
6. 日次評価(CSV + 可視化)
uv run atc report daily-eval \
--symbol ETH_JPY \
--start 2026-01-01 \
--end 2026-02-11 \
--strategy ml_hold10_softmax_overlay_derisk_only_aggressive \
--benchmark-hold-eth 10 \
--target-abs-qty-eth 10 \
--max-abs-position-eth 10 \
--plot-format png
得られる主な成果物:
- daily summary CSV
- overall summary CSV
- 日次PNG
- overview PNG
7. 低勝率区間の深掘り分析
2年安定性評価:
uv run python scripts/eval_stateful_two_year_stability.py \
--symbol ETH_JPY \
--start 2024-02-12 \
--end 2026-02-11 \
--window-days 21 \
--step-days 21 \
--workers 4 \
--progress-every 1
低勝率区間の注文分析:
uv run python scripts/analyze_stateful_low_win_interval.py \
--symbol ETH_JPY \
--start 2026-01-01 \
--end 2026-02-11 \
--plot-format both \
--plot-interval 5m \
--initial-position-eth 10 \
--benchmark-hold-eth 10 \
--target-abs-qty-eth 10 \
--max-abs-position-eth 10 \
--min-order-interval-sec 300
出力例:
daily_summary.csvorders_detailed.csv(open/add/reduce/close/flip分類付き)daily_charts/*.png/*.htmlfocus_overview.pngsummary.json
8. よくある不一致の原因
- データ期間が揃っていない
- モデルファイルが別のものを参照している
initial-position-ethとbenchmark-hold-ethの不一致min-order-interval-secが異なるenforce-session-closeの有無が異なる