← 返回
数据分析 中文

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...
加密期货回测引擎,支持内置 EMA、RSI、MACD、布林带策略,可从任意 ccxt 支持的交易所(如 Bybit、Binance 等)获取 OHLCV 数据。
sunnyztj
数据分析 clawhub v1.0.0 1 版本 99692.5 Key: 无需
★ 1
Stars
📥 1,601
下载
💾 90
安装
1
版本
#latest

概述

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

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 02:45 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 367 📥 140,030
data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 198 📥 64,892

TurboQuant Memory

sunnyztj
使用TurboQuant(ICLR 2026)在内存/检索增强生成系统中压缩并加速向量搜索——近最优向量量化,实现5-8倍压缩,98%+搜索效率...
★ 0 📥 358