Crypto Backtest
v1.0.0Crypto futures back测试 engine with built-in EMA, RSI, MACD, and Bollinger Band strategies. Fetches OHLCV data from any ccxt-supported exchange (Bybit, Binance, OKX, etc.), 运行s multi-strategy sweeps, calculates win rate / PnL / drawdown, and 导出s 结果s to JSON. Use when back测试 trading strategies, comparing parameter combinations, evaluating crypto trading 签名als, or building a quantitative trading 流水线.
运行时依赖
安装命令
点击复制技能文档
Crypto Backtest Engine
Fast, scriptable back测试 for crypto futures strategies. Fetches data via ccxt, 运行s strategies, 报告s 指标.
Quick 启动 pip 安装 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, Bit获取...) 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 导出: Machine-readable 结果s for 流水线 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 \ --输出 结果s.json
Custom Strategy
See references/custom_strategy.md for the plug-in interface.
输出 指标
Each backtest 报告s:
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 运行器 references/custom_strategy.md — 图形界面de for 添加ing custom strategies references/strategy_notes.md — Notes on each built-in strategy's edge cases