返回顶部
s

strategy-backtest

|

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
299
下载量
0
收藏
概述
安装方式
版本历史

strategy-backtest

# Strategy Backtest — Historical Performance & Optimization ## Overview Supports **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 ## Prerequisites ```bash pip install pandas numpy backtrader matplotlib ``` ## Capabilities 1. **Backtest engine** — run strategies on historical OHLCV (or vendor-specific) data. 2. **Performance analytics** — annualized return, max drawdown, Sharpe-like ratios, win rate (definitions must match your implementation). 3. **Parameter search** — grid or bounded search over strategy parameters with **out-of-sample** caution (see `references/strategy_backtest_guide.md`). ## Commands | 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]` | ## Usage (from repository root) ```bash 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. ## Output format (for the agent’s report) ```markdown # 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. ``` ## References ### Core - [Backtrader documentation](https://www.backtrader.com/docu/) - [Backtrader on GitHub](https://github.com/mementum/backtrader) ### Community & critique - [Hacker News — backtesting pitfalls](https://news.ycombinator.com/item?id=39462946) - [Reddit r/algotrading](https://www.reddit.com/r/algotrading/comments/1073140yyz/quant_backtest_ai/) ## Notes - Base all numbers on **script or notebook output**—never invent trades or metrics. - Mark missing fields as **unavailable** instead of guessing. - **Not investment advice**; comply with local regulations for research vs advisory. - Prefer stating **assumptions** (fees, spread, leverage, timezone, corporate actions).

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 strategy-backtest-1776024072 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 strategy-backtest-1776024072 技能

通过命令行安装

skillhub install strategy-backtest-1776024072

下载 Zip 包

⬇ 下载 strategy-backtest v1.0.0

文件大小: 5.22 KB | 发布时间: 2026-4-13 12:11

v1.0.0 最新 2026-4-13 12:11
- Initial release: backtest and optimize systematic trading strategies using historical data.
- Supports metrics like CAGR, max drawdown, Sharpe ratio, and win rate (based on actual output).
- Command-line interface for backtesting, parameter optimization, and reporting.
- Integrates with Backtrader for core backtest logic.
- Includes guidance on reproducibility, transparency, and risk caveats.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部