backtest-debugger

Diagnose failed backtests by classifying errors and editing signal_engine.py.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/loanntc/Paave --skill backtest-debugger
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backtest-debugger
Source: https://github.com/loanntc/Paave/tree/main/skills/backtest-diagnose
Command: npx skills add https://github.com/loanntc/Paave --skill backtest-debugger

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Backtests that fail or produce poor performance are hard to debug without systematically inspecting both the outputs and the underlying signal logic; this Skill identifies the root cause and guides targeted repairs.

Core Features & Use Cases

  • Artifact-driven diagnosis: Inspects artifacts/metrics.csv, artifacts/equity.csv, and artifacts/trades.csv to classify failures such as runtime errors, abnormal results, and suspicious trading behavior.
  • Code-focused root-cause analysis: Reviews code/signal_engine.py and config.json to pinpoint issues like data mapping mismatches, sizing logic bugs, missing exit handling, or dependency-related runtime errors.
  • Verification with guardrails: Applies a fix via edit_file, reruns the backtest, and validates outcomes by re-checking updated metrics.csv (including hard-gate checks like non-empty artifacts, NaN-free equity, and exit_code == 0).

Quick Start

Use the backtest-debugger skill to diagnose why your backtest failed or underperformed by inspecting the generated artifacts and updating the signal engine code until the rerun passes validation.

Frequently Asked Questions about backtest-debugger

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug a backtest that produces zero trades or an abnormal equity curve?

Debug failed backtests by inspecting artifacts like `metrics.csv`, `equity.csv`, and `trades.csv` to classify failures, then reviewing `signal_engine.py` to pinpoint data mapping mismatches or sizing logic bugs causing zero trades or abnormal equity curves.

Why does my backtesting strategy leave positions open or generate late trades?

Backtesting strategies leave positions open or generate late trades due to missing exit handling or logic bugs in the signal engine code, requiring targeted edits in `signal_engine.py` and validation through rerunning metrics checks.

What is the best way to diagnose NaN values or empty data conditions in backtest artifacts?

Diagnose NaN values or empty data conditions in backtest artifacts by mapping symptoms to an error taxonomy across `metrics.csv` and `equity.csv`, making precise edits in the signal engine, and validating with hard-gate checks for NaN-free equity.

How do I fix runtime errors in my Python backtesting signal engine?

Fix Python backtesting runtime errors by reviewing `signal_engine.py` and `config.json` to identify dependency-related issues or data mapping mismatches, applying edits, and rerunning the backtest until `exit_code == 0`.

Can I validate backtest fixes automatically using hard-gate checks?

Validate backtest fixes automatically by rerunning the strategy and applying hard-gate checks to updated `metrics.csv`, confirming non-empty artifacts, NaN-free equity curves, and `exit_code == 0` to ensure repaired backtests pass validation.