← Back to Skills Marketplace
sunnyztj

Crypto Backtest

by SunnyZhou · GitHub ↗ · v1.0.0
cross-platform ✓ Security Clean
1132
Downloads
1
Stars
6
Active Installs
1
Versions
Install in OpenClaw
/install crypto-backtest
Description
Crypto futures backtesting engine with built-in EMA, RSI, MACD, and Bollinger Band strategies. Fetches OHLCV data from any ccxt-supported exchange (Bybit, Bi...
README (SKILL.md)

Crypto Backtest Engine

Fast, scriptable backtesting for crypto futures strategies. Fetches data via ccxt, runs strategies, reports metrics.

Quick Start

pip install ccxt numpy
python scripts/backtest_engine.py --symbol ETH/USDT:USDT --strategy ema --fast 12 --slow 26

Features

  • Multi-exchange: Any ccxt-supported exchange (Bybit, Binance, OKX, Bitget...)
  • Built-in strategies: EMA crossover, RSI, MACD, Bollinger Bands
  • Parameter sweep: Test all combinations automatically
  • Risk simulation: Configurable leverage, position size, SL/TP, fees
  • JSON export: Machine-readable results for pipeline integration
  • Custom strategies: Simple plug-in interface

Usage

Single Strategy

python scripts/backtest_engine.py \
  --symbol SOL/USDT:USDT \
  --strategy rsi \
  --period 14 --oversold 30 --overbought 70 \
  --capital 1000 --leverage 5

Parameter Sweep

python scripts/sweep.py \
  --symbol ETH/USDT:USDT \
  --strategies ema,rsi,macd,bbands \
  --capital 1000 --leverage 5 \
  --output results.json

Custom Strategy

See references/custom_strategy.md for the plug-in interface.

Output Metrics

Each backtest reports:

  • Total trades, win rate, profit factor
  • Total PnL (absolute + percentage)
  • Max drawdown
  • Best/worst trade
  • Final balance

Files

  • scripts/backtest_engine.py — Core engine with EMA, RSI, MACD, Bollinger Bands
  • scripts/sweep.py — Multi-strategy parameter sweep runner
  • references/custom_strategy.md — Guide for adding custom strategies
  • references/strategy_notes.md — Notes on each built-in strategy's edge cases
Usage Guidance
This skill appears to be what it claims: a local backtesting engine that pulls public market data via ccxt, runs strategies, and writes JSON results. Before running: (1) review the included Python files locally (no obfuscation or hidden endpoints were found), (2) run pip installs in a virtual environment to avoid contaminating your system Python, (3) be aware it will make network requests to exchanges (rate limits apply), (4) do not provide exchange API keys unless you understand and intend to call private endpoints, and (5) treat backtest outputs as exploratory — validate any promising strategies with paper trading before risking real funds. Also check the included scripts for any syntax errors or truncation in your copy (the prompt excerpt was truncated in places; ensure the repository files are complete before use).
Capability Analysis
Type: OpenClaw Skill Name: crypto-backtest Version: 1.0.0 The OpenClaw skill bundle provides a crypto backtesting engine. All files, including the `SKILL.md` instructions, are aligned with the stated purpose. The Python scripts (`backtest_engine.py`, `sweep.py`) use standard libraries like `ccxt` for data fetching and `argparse` for command-line arguments. There is no evidence of data exfiltration, malicious execution (e.g., `curl|bash`, `eval` of untrusted input), persistence mechanisms, or prompt injection attempts against the AI agent. File I/O is limited to saving backtest results locally, which is an expected function. The code is straightforward and lacks obfuscation or suspicious dependencies.
Capability Assessment
Purpose & Capability
Name/description match the included code and SKILL.md. The code fetches OHLCV via ccxt and implements EMA, RSI, MACD, and Bollinger strategies and a sweep runner — all coherent with a backtest engine. No unexpected binaries or credentials are required.
Instruction Scope
SKILL.md instructs installing ccxt and numpy and running the provided scripts. The runtime instructions and the code operate only on market data fetched via ccxt and local parameter configs; there are no instructions to read unrelated system files, exfiltrate data to third-party endpoints, or access secrets.
Install Mechanism
There is no packaged install spec. The README suggests 'pip install ccxt numpy' which is a standard PyPI install for this functionality. No downloads from arbitrary URLs or archive extraction are used.
Credentials
The skill declares no required environment variables or credentials. That fits the code, which uses ccxt for public OHLCV fetches. Note: ccxt supports private APIs (requiring API keys) for trading/account endpoints — those are not needed for this skill unless the user modifies the code to call private endpoints.
Persistence & Privilege
always is false and the skill does not request persistent agent privileges. It writes only local output files (results JSON) as expected. It does not modify other skill configurations or system-wide settings.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install crypto-backtest
  3. After installation, invoke the skill by name or use /crypto-backtest
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of crypto-backtest: a fast, scriptable backtesting engine for crypto futures. - Supports fetching OHLCV data from any ccxt-supported exchange (Bybit, Binance, OKX, and more). - Includes built-in EMA crossover, RSI, MACD, and Bollinger Band strategies. - Enables multi-strategy parameter sweeps with automatic metric reporting (win rate, PnL, drawdown, etc.). - Exports machine-readable backtest results to JSON for integration with trading pipelines. - Simple plug-in interface for custom strategies.
Metadata
Slug crypto-backtest
Version 1.0.0
License
All-time Installs 6
Active Installs 6
Total Versions 1
Frequently Asked Questions

What is Crypto Backtest?

Crypto futures backtesting engine with built-in EMA, RSI, MACD, and Bollinger Band strategies. Fetches OHLCV data from any ccxt-supported exchange (Bybit, Bi... It is an AI Agent Skill for Claude Code / OpenClaw, with 1132 downloads so far.

How do I install Crypto Backtest?

Run "/install crypto-backtest" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Crypto Backtest free?

Yes, Crypto Backtest is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Crypto Backtest support?

Crypto Backtest is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Crypto Backtest?

It is built and maintained by SunnyZhou (@sunnyztj); the current version is v1.0.0.

💬 Comments