Install
openclaw skills install strategy-backtestQuantitative strategy backtesting—implement, run, and tune trading rules on historical data; performance metrics (CAGR, max drawdown, Sharpe, win rate) and simple parameter sweeps. Keywords: backtest, algorithmic trading, Backtrader, moving average, MACD, RSI, walk-forward, risk.
openclaw skills install strategy-backtestSupports systematic trading strategy workflows: backtest rules on history, optimize parameters (e.g. grid search), and report results. Typical building blocks include moving-average crosses, MACD, RSI, and custom signals—implemented with libraries such as Backtrader or similar.
Trigger keywords: backtest, trading strategy, quant, algorithmic trading, Sharpe, drawdown, optimize parameters, walk-forward
pip install pandas numpy backtrader matplotlib
references/strategy_backtest_guide.md).| Command | Description | Example |
|---|---|---|
backtest | Run a backtest | python3 scripts/skills/strategy-backtest/scripts/strategy_backtest_tool.py backtest [args] |
optimize | Parameter optimization | python3 scripts/skills/strategy-backtest/scripts/strategy_backtest_tool.py optimize [args] |
report | Emit a backtest report | python3 scripts/skills/strategy-backtest/scripts/strategy_backtest_tool.py report [args] |
python3 scripts/skills/strategy-backtest/scripts/strategy_backtest_tool.py backtest --strategy ma_cross --symbol SPY --period 3y
python3 scripts/skills/strategy-backtest/scripts/strategy_backtest_tool.py optimize --strategy ma_cross --fast 5-20 --slow 20-60
python3 scripts/skills/strategy-backtest/scripts/strategy_backtest_tool.py report --format markdown
Use symbols and venues appropriate to your data feed (e.g. SPY, QQQ, or local indices)—the examples above are illustrative.
# Strategy backtest report
**Generated**: YYYY-MM-DD HH:MM
## Key findings
1. [Finding 1]
2. [Finding 2]
3. [Finding 3]
## Metrics snapshot
| Metric | Value | Notes |
|--------|-------|-------|
| CAGR | X% | … |
| Max drawdown | Y% | … |
| Sharpe (if defined) | Z | window & rf assumption |
## Analysis
[Grounded in actual run outputs—no fabricated fills or equity curves.]
## Risks & limitations
- Past performance ≠ future results; costs, slippage, and survivorship bias matter.