BinanceSimu is a sophisticated cryptocurrency trading simulator and strategy execution platform. It features a unique architecture that monitors Spot market signals while executing trades in the Perpetual Futures market. The system uses a high-frequency MACD strategy (5, 10, 3) to capture market momentum.
BinanceSimu 是一个高级加密货币交易模拟器和策略执行平台。其核心特性在于独特的架构:监控现货市场信号,同时在永续合约市场执行交易。系统采用高频 MACD 策略 (5, 10, 3) 来捕捉市场动量。
-
Hybrid Architecture: Monitor Spot (low noise) and trade Futures (leverage).
-
Real-time Dashboard: Live price tracking, equity curves, and MACD signal visualization.
-
Automated Strategy: Fully automated MACD Golden/Dead cross execution.
-
Manual Control: One-click manual open/close for emergency intervention.
-
Risk Management: Configurable leverage (default 10x) and isolated margin mode.
-
混合架构:监控现货(低噪音信号)并交易合约(利用杠杆)。
-
实时仪表盘:实时价格追踪、资金曲线和 MACD 信号可视化。
-
自动化策略:全自动 MACD 金叉/死叉执行。
-
手动控制:一键手动开/平仓,用于紧急干预。
-
风险管理:可配置杠杆(默认 10x)和逐仓保证金模式。
graph LR
A[Binance Spot API] -->|K-Lines| B(Data Collector)
B --> C{MACD Strategy}
C -->|Signal| D[Trading Engine]
D -->|Order| E[Binance Futures API]
E -->|Execution| F((Profit/Loss))
- Python 3.8+
- Conda (Recommended)
# Clone the repository
git clone https://github.com/your-repo/BinanceSimu.git
cd BinanceSimu
# Create and activate environment
conda create -n binanceSimu python=3.11
conda activate binanceSimu
# Install dependencies
pip install -r requirements.txt
pip install binance-futures-connectorCreate a .env file in the root directory:
在根目录创建 .env 文件:
# Spot Testnet (for monitoring)
BINANCE_API_KEY=your_spot_key
BINANCE_API_SECRET=your_spot_secret
BINANCE_MODE=testnet
# Futures Testnet (for trading)
BINANCE_FUTURES_API_KEY=your_futures_key
BINANCE_FUTURES_API_SECRET=your_futures_secret- Visit testnet.binance.vision.
- Log in with your GitHub account.
- Generate "HMAC" API Key.
- Visit testnet.binancefuture.com.
- Register/Login to the futures testnet account.
- Locate the "API Key" tab at the bottom and generate a new key.
- Note: Spot and Futures testnet keys are NOT interchangeable.
- Start the Server:
python app.py
- Access Dashboard:
Open
http://localhost:5431in your browser. - Start Strategy: Click the "Start Strategy" button to begin automated trading.
Author: 江景哲 (JIANG JINGZHE)
Email: contact@jiangjingzhe.com
Portfolio: BinanceSimu Project
This project is licensed under the Apache License 2.0 - see the LICENSE file for details. 本项目采用 Apache 2.0 许可证 - 详见 LICENSE 文件。