スキル一覧に戻る
gevans3000

strategy-backtest

by gevans3000

0🍴 0📅 2026年1月25日
GitHubで見るManusで実行

SKILL.md


name: strategy-backtest description: Backtest a strategy and compare performance against the baseline

Strategy Backtest Skill

This skill runs a full backtest on any named strategy and compares it against the default baseline.

Usage

Invoke with: /strategy-backtest <strategy_name> [bars]

Examples:

  • /strategy-backtest scalp_1m_sweep
  • /strategy-backtest scalp_1m_sweep 2000

Parameters

  • strategy_name (required): Name of strategy file in config/strategies/ (without .json)
  • bars (optional): Number of bars to backtest (default: 1000)

Steps

// turbo-all

Step 1: Validate Strategy Exists

$strategyPath = "config/strategies/$strategyName.json"
if (-not (Test-Path $strategyPath)) {
    Write-Error "Strategy not found: $strategyPath"
    exit 1
}
Write-Host "Strategy found: $strategyPath"

Step 2: Run Baseline Backtest

Run default strategy first to establish baseline:

$env:PYTHONPATH="src"; .\.venv\Scripts\python.exe -m src.laptop_agents.run --mode backtest --source mock --backtest $bars

Save metrics from runs/latest/stats.json as baseline.

Step 3: Run Target Strategy Backtest

$env:PYTHONPATH="src"; .\.venv\Scripts\python.exe -m src.laptop_agents.run --strategy $strategyName --mode backtest --source mock --backtest $bars

Step 4: Extract Metrics

Parse runs/latest/stats.json for:

  • net_pnl: Net Profit/Loss
  • max_drawdown: Maximum Drawdown
  • trade_count: Number of trades
  • win_rate: Win percentage
  • sharpe_ratio: Risk-adjusted return (if available)

Step 5: Generate Comparison Report

Output a comparison table:

MetricBaseline (default)Target ($strategyName)Delta
Net PnL$X$Y+/-$Z
Max DrawdownX%Y%+/-Z%
Trade CountNM+/-K
Win RateX%Y%+/-Z%

Step 6: Pass/Fail Determination

The strategy PASSES if:

  • Net PnL > 0
  • Max Drawdown < 10%
  • Trade Count > 10

Output Artifacts

  • Comparison table printed to console
  • Full results available in runs/latest/

On Failure

  • Report which criteria failed
  • Suggest parameter adjustments if drawdown is too high

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です