benchmarking-performance
Trading performance evaluation via backtesting and metrics
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Trading performance evaluation via backtesting and metrics
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
TDD workflow for implementing features
Test and validation workflow before commit
Keep project documentation up to date
Manage and enforce project specifications for consistency
Designing premium user interfaces with egui
Critical analysis of trading techniques and financial innovation
| name | Benchmarking & Performance |
| description | Trading performance evaluation via backtesting and metrics |
| Script | Usage |
|---|---|
scripts/quick_benchmark.sh SYMBOL [DAYS] | Quick benchmark |
scripts/validate_strategy.sh STRATEGY | Multi-period validation |
| Metric | Description | Acceptable threshold |
|---|---|---|
| Total Return | Total return over period | > 0% |
| Win Rate | % of winning trades | > 50% (trend) or > 40% (mean rev) |
| Profit Factor | Gains / Losses | > 1.5 |
| Average Trade | Average P&L per trade | > 0 |
| Metric | Description | Acceptable threshold |
|---|---|---|
| Sharpe Ratio | Risk-adjusted return | > 1.0 (good), > 2.0 (excellent) |
| Sortino Ratio | Same but penalizes downside | > 1.5 |
| Max Drawdown | Maximum loss from peak | < 20% |
| Time in Market | % of time with position | Depends on strategy |
Sharpe Ratio:
< 0.5 → Bad, don't use
0.5-1 → Mediocre, needs improvement
1-2 → Good
2-3 → Very good
> 3 → Excellent (or suspicious, check overfitting)
Max Drawdown:
< 10% → Conservative
10-20% → Moderate
20-30% → Aggressive
> 30% → Dangerous
# Backtest on one symbol
cargo run --bin benchmark -- --symbol AAPL --days 365
# Backtest on multiple symbols
cargo run --bin benchmark -- --symbols "AAPL,GOOGL,MSFT" --days 365
# Parallel mode (multi-core)
cargo run --bin benchmark -- --parallel --symbols "AAPL,GOOGL,MSFT"
# With sequential comparison
cargo run --bin benchmark -- --compare-sequential
# Parameter matrix
cargo run --bin benchmark_matrix
# Stock benchmark
./scripts/benchmark_stocks.sh
# Market regime benchmark
./scripts/run_regime_benchmarks.sh
# Automatic benchmark
./scripts/auto_benchmark.sh
cargo run --bin benchmark -- --strategy <STRATEGY> --days 365
Verify:
# Bull period
cargo run --bin benchmark -- --start 2021-01-01 --end 2021-12-31
# Bear period
cargo run --bin benchmark -- --start 2022-01-01 --end 2022-12-31
# Volatile period
cargo run --bin benchmark -- --start 2020-02-01 --end 2020-04-30
The strategy must be profitable (or at least not lose too much) in ALL conditions.
cargo run --bin benchmark -- --symbols "AAPL,MSFT,GOOGL,AMZN,META"
Verify result consistency across different assets.
Test on crash periods:
Symptoms:
Solutions:
Symptom: Using future data in decisions
Solution: Verify indicators only use past data
Symptom: Only testing on assets that still exist
Solution: Include delisted assets in backtests
| File | Description |
|---|---|
src/bin/benchmark.rs | Main benchmark CLI |
src/bin/benchmark_matrix.rs | Parameter matrix tests |
src/application/optimization/parallel_benchmark.rs | Parallel execution |
src/application/optimization/benchmark_metrics.rs | Benchmark metrics |
src/domain/performance/metrics.rs | Sharpe, Sortino, Drawdown calculation |
benchmark_results/ | Saved results |