backtester

Professional backtesting framework for trading strategies. Tests SMA crossover, RSI, MACD, Bollinger Bands, and custom strategies on historical data. Generates equity curves, drawdown analysis, and performance metrics.

3,891 stars
Complexity: easy

About this skill

The Beta Backtester is a professional quantitative tool designed to rigorously validate trading strategies using historical OHLCV data from various assets like stocks, cryptocurrencies, and forex. It provides a comprehensive suite of features for assessing strategy performance, including calculating key metrics such as Sharpe Ratio, Sortino Ratio, Max Drawdown, and Win Rate, alongside generating visual aids like equity curves and drawdown charts. This skill supports testing a range of popular strategies, including SMA Crossover, RSI, MACD, and Bollinger Bands, and also allows users to implement custom entry/exit logic. It enables side-by-side comparison of multiple strategies and facilitates parameter optimization to achieve superior risk-adjusted returns. Traders, quantitative analysts, and financial developers can leverage this tool to thoroughly evaluate the efficacy and robustness of their investment approaches, minimizing risk and enhancing decision-making before committing real capital to live deployment.

Best use case

The primary use case is the rigorous evaluation and validation of trading strategies using historical data. It benefits quantitative traders, financial analysts, and algorithm developers who need to assess the profitability and risk profile of their investment approaches before live deployment.

Professional backtesting framework for trading strategies. Tests SMA crossover, RSI, MACD, Bollinger Bands, and custom strategies on historical data. Generates equity curves, drawdown analysis, and performance metrics.

Users should expect a detailed report outlining a trading strategy's historical performance, including profitability metrics, risk analysis, and graphical representations like equity curves.

Practical example

Example input

Backtest an RSI strategy for BTC over 1 year, with RSI upper bound 70 and lower bound 30.

Example output

BACKTEST RESULTS: RSI | BTC | 2023
Total Return: +X.X%
Annual Return: +Y.Y%
Sharpe Ratio: Z.Z
Max Drawdown: -A.A%
Win Rate: B%

When to use this skill

  • When developing or refining new trading strategies.
  • To compare the historical performance of different investment approaches.
  • Before deploying a trading strategy with real capital.
  • To optimize strategy parameters for improved risk-adjusted returns.

When not to use this skill

  • For executing live trades or managing a live portfolio.
  • When real-time market data analysis is required (it uses historical data).
  • If your focus is solely on fundamental analysis (this is a technical analysis tool).
  • For simply monitoring market conditions without testing a specific strategy.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/betabacktestr/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/1477009639zw-blip/betabacktestr/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/betabacktestr/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How backtester Compares

Feature / AgentbacktesterStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityeasyN/A

Frequently Asked Questions

What does this skill do?

Professional backtesting framework for trading strategies. Tests SMA crossover, RSI, MACD, Bollinger Bands, and custom strategies on historical data. Generates equity curves, drawdown analysis, and performance metrics.

How difficult is it to install?

The installation complexity is rated as easy. You can find the installation instructions above.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# 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

```bash
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*

Related Skills

MarketPulse

3891
from openclaw/skills

Query real-time and historical financial data across equities and crypto—prices, market moves, metrics, and trends for analysis, alerts, and reporting.

Finance & Investing

Portfolio Risk Analyzer

3891
from openclaw/skills

Complete investment portfolio risk management system. Analyze positions, calculate risk metrics, stress test scenarios, optimize allocations, and generate institutional-grade risk reports — all without external APIs.

Finance & Investing

Debt Collection & Recovery Playbook

3891
from openclaw/skills

Generate compliant debt recovery strategies, collection letter sequences, and payment plan frameworks.

Finance & Investing

Cash Flow Forecast

3891
from openclaw/skills

Build a 13-week rolling cash flow forecast from your actual numbers.

Finance & Investing

moltycash

3891
from openclaw/skills

Send USDC to molty users via A2A protocol. Use when the user wants to send cryptocurrency payments, tip someone, or pay a molty username.

Finance & Investing

second-level-thinking

3891
from openclaw/skills

Apply Howard Marks' Second Level Thinking framework to investment decisions. Use this skill whenever the user is analyzing an investment opportunity, evaluating a trade thesis, stress-testing a conviction, or asking whether a stock/asset/market is actually as attractive as it looks. Also trigger when the user wants to challenge their own reasoning ("am I just following the crowd?"), wants to identify what the market is mispricing, is debating whether a consensus view is already fully reflected in price, or asks about risk/reward asymmetry, market cycles, or contrarian positioning. The skill channels Marks' philosophy: superior returns require being different AND right — and that starts with understanding what everyone already believes.

Finance & Investing

vynn-backtester

3891
from openclaw/skills

Run trading strategy backtests with natural language — powered by Vynn

investor-materials

144923
from affaan-m/everything-claude-code

Create and update pitch decks, one-pagers, investor memos, accelerator applications, financial models, and fundraising materials. Use when the user needs investor-facing documents, projections, use-of-funds tables, milestone plans, or materials that must stay internally consistent across multiple fundraising assets.

Finance & InvestingClaude

billing-automation

31392
from sickn33/antigravity-awesome-skills

Master automated billing systems including recurring billing, invoice generation, dunning management, proration, and tax calculation.

Finance & InvestingClaude

emblemai-crypto-wallet

31355
from sickn33/antigravity-awesome-skills

Crypto wallet management across 7 blockchains via EmblemAI Agent Hustle API. Balance checks, token swaps, portfolio analysis, and transaction execution for Solana, Ethereum, Base, BSC, Polygon, Hedera, and Bitcoin.

Finance & InvestingClaude

backtesting-frameworks

31355
from sickn33/antigravity-awesome-skills

Build robust, production-grade backtesting systems that avoid common pitfalls and produce reliable strategy performance estimates.

Finance & InvestingClaude

---

3891
from openclaw/skills

name: article-factory-wechat

Content & Documentation