Skip to content

Backtest Command

Prerequisites

  • Strategy validates successfully on target date bounds.
  • Canonical source dataset is merged_metrics*.parquet (see Merged Metrics Parquet Schema).
  • Runtime BRK-wide parquet covers the requested window and can resolve from STACKSATS_ANALYTICS_PARQUET, managed default ~/.stacksats/data/bitcoin_analytics.parquet, or ./bitcoin_analytics.parquet.

Command

stacksats strategy backtest \
  --strategy simple-zscore \
  --start-date 2024-01-01 \
  --end-date 2024-12-31 \
  --output-dir output

Built-in strategy catalog and expected behavior: Strategies.

Expected output

  • Run artifacts under output/<strategy_id>/<version>/<run_id>/.
  • Includes backtest_result.json, metrics.json, and plot .svg files.

Key options

  • --strategy-config <path>: strategy params JSON.
  • default scoring bounds if omitted: start 2018-01-01, end 2025-12-31 (clamped to available data).
  • --strategy-label <text>: label override for run context.
  • --output-dir <dir>: artifact root (default output).

Troubleshooting

  • If date range fails, verify ordering and source coverage.
  • If outputs drift across runs, run validation in strict mode and inspect diagnostics.

Next step

Feedback