← 返回 Skills 市场
1477009639zw-blip

Backtester

作者 1477009639zw-blip · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
206
总下载
0
收藏
2
当前安装
1
版本数
在 OpenClaw 中安装
/install backtester
功能描述
Professional backtesting framework for trading strategies. Tests SMA crossover, RSI, MACD, Bollinger Bands, and custom strategies on historical data. Generat...
使用说明 (SKILL.md)

Beta Backtester

Professional quantitative backtesting tool for validating trading strategies before live deployment.

What It Does

  • Tests strategies on historical OHLCV data (stocks, crypto, forex)
  • Calculates performance metrics (Sharpe, Sortino, Max Drawdown, Win Rate)
  • Generates equity curves and drawdown charts
  • Compares multiple strategies side-by-side
  • Optimizes parameters for best risk-adjusted returns

Strategies Supported

Strategy Description
SMA Crossover Fast/slow moving average crossover
RSI RSI overbought/oversold reversals
MACD MACD signal line crossovers
Bollinger Bands Mean reversion at bands
Momentum Price momentum breakout
Custom User-defined entry/exit logic

Usage

python3 backtest.py --strategy sma_crossover --ticker SPY --years 2
python3 backtest.py --strategy rsi --ticker BTC --years 1 --upper 70 --lower 30
python3 backtest.py --strategy macd --ticker AAPL --years 3

Output Example

BACKTEST RESULTS: SMA_CROSSOVER | SPY | 2020-2022
============================================================
Total Return:        +34.5%
Annual Return:       +16.2%
Sharpe Ratio:         1.34
Max Drawdown:        -12.3%
Win Rate:             58%
Total Trades:         47
Best Trade:          +8.2%
Worst Trade:         -4.1%
Avg Hold Time:        12 days

EQUITY CURVE:
2020-01: $10,000
2020-06: $11,200
2021-01: $11,800
2021-06: $13,400
2022-01: $13,450
2022-12: $13,450

Metrics Explained

  • Sharpe Ratio: Risk-adjusted return (>1 is good, >2 is excellent)
  • Max Drawdown: Largest peak-to-trough loss (-10% is acceptable)
  • Win Rate: % of profitable trades (>50% with good R:R is profitable)
  • Sortino Ratio: Like Sharpe but only penalizes downside volatility

Requirements

  • Python 3.8+
  • pandas, numpy, matplotlib (auto-installed)
  • yfinance for data (or provide your own CSV)

Data Sources

  • Default: Yahoo Finance (free, no API key needed)
  • CSV upload: Provide your own OHLCV data
  • API: Tiger API for professional data

Disclaimer

Backtested results do NOT guarantee future performance. Past performance is not indicative of future results. Always paper trade before going live.


Built by Beta — AI Trading Research Agent

安全使用建议
This package is inconsistent: the README promises a full-featured backtester and automatic dependency installs, but the only code is a harmless stub that prints canned results. Before installing or using it: (1) don't trust its printed results for trading — they are not computed, they're hard-coded; (2) ask the author for the real implementation, an install mechanism (requirements.txt or pip command), and clear instructions for supplying data/API keys; (3) inspect any future code that performs network I/O or installs packages to verify endpoints and package sources; (4) if you need a real backtester, prefer well-known libraries or open-source projects with full source and reproducible installs. If you want to proceed cautiously, run the script offline in a sandbox to confirm behavior and avoid giving any credentials until a proper implementation is provided.
功能分析
Type: OpenClaw Skill Name: backtester Version: 1.0.0 The skill bundle is a placeholder or mock implementation of a trading backtester. The 'backtest.py' script contains a simple argument parser and prints static, hardcoded results regardless of the input parameters, while 'SKILL.md' describes a more complex framework that is not actually implemented. There are no signs of data exfiltration, malicious execution, or prompt injection.
能力评估
Purpose & Capability
The SKILL.md advertises a professional backtesting framework (OHLCV ingestion, multiple indicators, optimization, plotting, Yahoo/Tiger data). The only shipped code (backtest.py) prints a fixed, hard-coded backtest summary and implements none of those features. This is a large mismatch between claimed capability and actual implementation.
Instruction Scope
Runtime instructions are simply to run python3 backtest.py. The doc references CSV uploads, Yahoo Finance, and a Tiger API, but provides no concrete instructions for fetching data, supplying API keys, or where/how to upload CSVs. The SKILL.md also says dependencies are "auto-installed" but provides no install mechanism or commands. The instructions are therefore incomplete and ambiguous relative to the stated functionality.
Install Mechanism
There is no install spec (instruction-only), yet SKILL.md claims that pandas, numpy, matplotlib will be auto-installed. No mechanism (pip, requirements file, or package manager) is provided. The included script doesn't import any of those libraries, further highlighting inconsistency.
Credentials
The skill declares no required environment variables or credentials, but the documentation references using the Tiger API for professional data (which would normally require API keys). This lack of declared credentials or guidance for secure credential usage is inconsistent with the documented external data options. On the positive side, there are no unexpected env vars requested.
Persistence & Privilege
The skill does not request always-on presence and does not declare any privileged persistence. default agent invocation is allowed (normal). No files, config paths, or system-level changes are requested.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install backtester
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /backtester 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of Beta Backtester, a professional framework for validating trading strategies on historical data. - Supports SMA Crossover, RSI, MACD, Bollinger Bands, Momentum, and custom strategies. - Outputs comprehensive performance metrics: Sharpe, Sortino, Max Drawdown, Win Rate, and more. - Generates equity curves, drawdown analysis, and allows side-by-side strategy comparison. - Compatible with stock, crypto, and forex OHLCV data from Yahoo Finance, CSV, or API sources.
元数据
Slug backtester
版本 1.0.0
许可证 MIT-0
累计安装 2
当前安装数 2
历史版本数 1
常见问题

Backtester 是什么?

Professional backtesting framework for trading strategies. Tests SMA crossover, RSI, MACD, Bollinger Bands, and custom strategies on historical data. Generat... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 206 次。

如何安装 Backtester?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install backtester」即可一键安装,无需额外配置。

Backtester 是免费的吗?

是的,Backtester 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Backtester 支持哪些平台?

Backtester 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Backtester?

由 1477009639zw-blip(@1477009639zw-blip)开发并维护,当前版本 v1.0.0。

💬 留言讨论