Skip to content
Agentmart
Submit a tool
This entry duplicates backtesting-trading-strategies, which is the one we list in search.

backtesting-trading-strategies

Backtest crypto and traditional trading strategies against historical data.

Skill by shaoxing-xie

IndexedMIT★ 37
Write a review

Chalk Labs

Need help deploying backtesting-trading-strategies?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/shaoxing-xie-backtesting-trading-strategies

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

Use cases: testing, data, finance

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions: not checked yet.

What's inside

Skill name
backtesting-trading-strategies
Description
Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".
License
MIT
Allowed tools
Read,, Write,, Edit,, Grep,, Glob,, Bash(python:*)
Instructions
254 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts
  • Pre-approves some shell commands

Files (30)

  • origin.json · .clawhub/
  • SKILL.md
  • _meta.json
  • settings.yaml · config/
  • errors.md · references/
  • examples.md · references/
  • implementation.md · references/
  • optimization_rsi_reversal_20260417_083012.txt · reports/
  • rsi_reversal_510300.SS_20260417_064322_chart.png · reports/
  • rsi_reversal_510300.SS_20260417_064322_summary.txt · reports/
  • rsi_reversal_510300.SS_20260417_065003_chart.png · reports/
  • rsi_reversal_510300.SS_20260417_065003_summary.txt · reports/
  • rsi_reversal_510300.SS_20260417_082915_chart.png · reports/
  • rsi_reversal_510300.SS_20260417_082915_summary.txt · reports/
  • rsi_reversal_510300_20260417_083032_chart.png · reports/
  • rsi_reversal_510300_20260417_083032_summary.txt · reports/
  • rsi_reversal_BTC-USD_20260417_082919_chart.png · reports/
  • rsi_reversal_BTC-USD_20260417_082919_summary.txt · reports/
  • rsi_reversal_BTC-USD_20260417_083026_chart.png · reports/
  • rsi_reversal_BTC-USD_20260417_083026_summary.txt · reports/
  • rsi_reversal_ETH-USD_20260417_083034_chart.png · reports/
  • rsi_reversal_ETH-USD_20260417_083034_summary.txt · reports/
  • backtest.py · scripts/
  • china_stock_loader.py · scripts/
  • fetch_data.py · scripts/
  • metrics.py · scripts/
  • optimize.py · scripts/
  • skill_settings.py · scripts/
  • strategies.py · scripts/
  • skill.json

SKILL.md (first lines)

# Backtesting Trading Strategies

## Overview

Validate trading strategies against historical data before risking real capital. This skill provides a complete backtesting framework with 8 built-in strategies, comprehensive performance metrics, and parameter optimization.

**Key Features:**
- 8 pre-built trading strategies (SMA, EMA, RSI, MACD, Bollinger, Breakout, Mean Reversion, Momentum)
- Full performance metrics (Sharpe, Sortino, Calmar, VaR, max drawdown)
- Parameter grid search optimization
- Equity curve visualization
- Trade-by-trade analysis

## Prerequisites

Install required dependencies:

```bash
pip install pandas numpy yfinance matplotlib
```

For **A-share / ETF** backtests (6-digit codes such as `510300` or `510300.SS`), the scripts load history via this repo’s `plugins/data_collection` stack (AkShare, mootdx, project cache — same strategy as `openclaw-data-china-stock`). Install:

```bash
pip install akshare
```

Optional for advanced features:
```bash
pip install ta-lib scipy scikit-learn
```

## Instructions

### Step 1: Fetch Historical Data

Crypto / US (Yahoo):

```bash
python {baseDir}/scripts/fetch_data.py --symbol BTC-USD --period 2y --interval 1d --source yfinance
```

China ETF (plugin-aligned pipeline, default for `--source auto` when symbol is a 6-digit code):

```bash
python {baseDir}/scripts/fetch_data.py --symbol 510300.SS --period 2y --interval 1d --source auto
```

Data is cached to `{baseDir}/data/{symbol}_{interval}.csv` for reuse.

### Step 2: Run Backtest

Basic backtest with default parameters:

```bash
python {baseDir}/scripts/backtest.py --strategy sma_crossover --symbol BTC-USD --period 1y --data-source yfinance
```

China ETF (uses `plugins/data_collection` automatically; no Yahoo):

```bash
python {baseDir}/scripts/backtest.py --strategy sma_crossover --symbol 510300.SS --period 1y
```

Advanced backtest with custom parameters:

```bash
# Example: backtest with specific date range
python {baseDir}/scripts/backtest.py \
  --strategy rsi_reversal \
  --symbol ETH-USD \
  --period 1y \
  --capital 10000 \
  --params '{"period": 14, "overbought": 70, "oversold": 30}'
```

### Step 3: Analyze Results

Results are saved to `{baseDir}/reports/` including:
- `*_summary.txt` - Performance metrics
- `*_trades.csv` - Trade log
- `*_equity.csv` - Equity curve data
- `*_chart.png` - Visual equity curve

### Step 4: Optimize Parameters

Find optimal parameters via grid search:

```bash
python {baseDir}/scripts/optimize.py \
  --strategy sma_crossover \
  --symbol BTC-USD \
  --period 1y \
  --param-grid '{"fast_period": [10, 20, 30], "slow_period": [50, 100, 200]}'
```

## Output

### Performance Metrics

| Metric | Description |
|--------|-------------|
| Total Return | Overall percentage gain/loss |
| CAGR | Compound annual growth rate |
| Sharpe Ratio | Risk-adjusted return (target: >1.5) |
| Sortino Ratio | Downside risk-adjusted return |
| Calmar Ratio | Return divided by max drawdown |

### Risk Metrics

| Metric | Description |
|--------|-------------|
| Max Drawdown | Largest peak-to-trough decline |
| VaR (95%) | Value at Risk at 95% confidence |
| CVaR (95%) | Expected loss beyond VaR |
| Volatility | Annualized standard deviation |

### Trade Statistics

From shaoxing-xie/etf-options-ai-assistant, MIT.

More from shaoxing-xie/etf-options-ai-assistant

Signals

Stars
37
Forks
9
Open issues
1
Last commit (this folder)
Apr 19, 2026 (6 months ago)
Last release
Apr 14, 2026 (6 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

Same skill elsewhere

Copies of this SKILL.md published by others; search shows only one of them.

More from shaoxing-xie

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get backtesting-trading-strategies running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying backtesting-trading-strategies?

CallGet help
Cite this page

backtesting-trading-strategies skill. Agent Mart. https://agentmart.dev/skills/shaoxing-xie-backtesting-trading-strategies (last updated 2026-10-24)