MACDBasicStrategybasedonBinanceTestnet
A sophisticated cryptocurrency trading simulator and strategy execution platform that monitors Binance Spot market signals to execute trades in the Perpetual Futures market using a high-frequency MACD strategy. Features a real-time dashboard, automated execution, and hybrid market architecture.
Install / Use
npx skills add khakhasshi/MACDBasicStrategybasedonBinanceTestnetInstalls into whichever agent you are using.
README
🤖 BinanceSimu: MACD Strategy Trading Console
币安模拟交易 - MACD 策略控制台
📖 Introduction / 简介
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) 来捕捉市场动量。
✨ Key Features / 主要功能
-
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)和逐仓保证金模式。
🏗 Architecture / 系统架构
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))
🚀 Deployment / 部署流程
1. Prerequisites / 环境准备
- Python 3.8+
- Conda (Recommended)
2. Installation / 安装步骤
# 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-connector
3. Configuration / 配置变量
Create 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
🔑 API Application / 申请 API
Spot Testnet / 现货测试网
- Visit testnet.binance.vision.
- Log in with your GitHub account.
- Generate "HMAC" API Key.
Futures Testnet / 合约测试网
- 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.
🛠 Usage / 使用方法
- 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.
👤 Contact / 联系方式
Author: 江景哲 (JIANG JINGZHE)
Email: contact@jiangjingzhe.com
Portfolio: BinanceSimu Project
📄 License / 许可证
This project is licensed under the Apache License 2.0 - see the LICENSE file for details. 本项目采用 Apache 2.0 许可证 - 详见 LICENSE 文件。
Related Skills
node-connect
385.5kDiagnose OpenClaw Android, iOS, or macOS node pairing, QR/setup code, route, auth, and connection failures.
python-debugpy
385.5kDebug Python with pdb, breakpoint(), post-mortem inspection, and debugpy remote attach.
skill-creator
385.5kCreate, edit, audit, tidy, validate, or restructure AgentSkills and SKILL.md files.
claude-opus-4-5-migration
140.6kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
Languages
Security Score
Audited on Apr 25, 2026
