From tradeblocks
Performance comparison for trading strategies. Compare backtest vs actual results, strategy vs strategy metrics, block vs block, or period vs period performance. Use when exploring differences between theoretical and live execution, understanding how two strategies relate, or analyzing performance across time periods.
How this skill is triggered — by the user, by Claude, or both
Slash command
/tradeblocks:compareThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Explore differences between strategies, execution modes, or time periods.
Explore differences between strategies, execution modes, or time periods.
Ask the user what they want to compare:
| Type | Use Case | Primary Tool |
|---|---|---|
| Backtest vs Actual | Explore theoretical vs live execution | compare_backtest_to_actual |
| Strategy vs Strategy (same block) | Compare strategies within a portfolio | get_strategy_comparison |
| Block vs Block | Compare separate portfolios side-by-side | compare_blocks / block_diff |
| Period vs Period | Analyze same strategy across time ranges | get_period_returns |
Ask: "What would you like to compare?"
Use compare_backtest_to_actual to explore how theoretical performance compares to live execution.
Key parameters:
blockId: Block folder namescaling: How to compare P&L fairly (see below)strategy: Optional filter to specific strategydateRange: Optional date filtermatchedOnly: Only include trades where both backtest and actual existgroupBy: Group results by "none", "strategy", "date", "week", or "month"detailLevel: "summary" (aggregate by date+strategy) or "trades" (individual trade comparison with field-by-field differences)outliersOnly: Only return high-slippage outliers (z-score threshold)outliersThreshold: Z-score threshold for outlier detection (default: 2)Scaling modes (see references/scaling.md):
| Mode | What It Does | Use When |
|---|---|---|
raw | Shows P&L as-is | Contract sizes match between backtest and actual |
perContract | Divides each P&L by contract count | Comparing per-lot performance regardless of size |
toReported | Scales backtest DOWN to match actual contract count | Backtest uses more contracts than actual |
Recommended approach:
groupBy: "strategy" and scaling: "perContract" for an overviewgroupBy: "month" to spot trendsoutliersOnly: true to find the worst slippage tradesdetailLevel: "trades" for field-by-field comparison on outliersTool returns:
Present findings from the data:
For comparing strategies within the same block, use get_strategy_comparison:
Key parameters:
blockId: Block folder namesortBy: "netPl", "winRate", "trades", "profitFactor", "name"sortOrder: "asc" or "desc"minTrades: Minimum trades per strategy to includestartDate / endDate: Optional date filtersTool returns per strategy:
Present as a ranked table:
| Strategy | Trades | Win Rate | Net P&L | Profit Factor |
|---|---|---|---|---|
| ... | ... | ... | ... | ... |
For deeper comparison between two specific strategies, also run:
get_correlation_matrix to understand how they move togetherget_statistics on each (with strategy filter) for full metric suitesCorrelation context:
For comparing separate portfolio blocks:
Option 1: Side-by-side metrics via compare_blocks:
blockIds: Array of block IDs (max 5)metrics: Optional filter to specific metrics (e.g., ["sharpeRatio", "maxDrawdown", "profitFactor"])sortBy: Sort by any metricOption 2: Strategy overlap analysis via block_diff:
blockIdA: First block (baseline)blockIdB: Second block (comparison target)Use compare_blocks for a quick overview, then block_diff when blocks share strategies and you want to understand what changed.
For analyzing performance across time:
Use get_period_returns with period type and optional date filters.
Key parameters:
period: "monthly", "weekly", or "daily"dateRange: Optional filter to specific time rangenormalizeTo1Lot: Normalize for fair comparison across different position sizesstrategy: Optional strategy filterPresent period breakdown:
Questions to explore:
Synthesize the data into what stands out:
Comparison Summary:
What the data shows:
Context for interpretation:
Present these as observations from the historical data. The user can decide what meaning to draw from the findings.
For detailed explanation of scaling modes, see references/scaling.md.
After comparison analysis:
/tradeblocks:health-check - Deep dive into either strategy/tradeblocks:portfolio - Explore correlation and diversification/tradeblocks:wfa - Test parameter robustnessnpx claudepluginhub davidromeo/tradeblocks-skills --plugin tradeblocksBacktests crypto/stock trading strategies on historical data. Computes Sharpe/Sortino ratios, drawdowns; plots equity curves; optimizes parameters via grid search.
Builds financial models, backtests trading strategies, and analyzes market data with risk metrics, portfolio optimization, and statistical arbitrage.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.