EchoTradeBot is a sophisticated crypto copy trading bot that mirrors high-ROI Binance traders with comprehensive risk management. The bot focuses on profitability by copying traders like Yun Qiang (+1700% 30d ROI) with proper position sizing, stop losses, and drawdown protection.
- High-ROI Trader Mirroring: Copy top-performing traders like Yun Qiang, Crypto Loby
- Advanced Risk Management: 2% position sizing, 2% stop-loss, <30% max drawdown
- Multiple Trading Pairs: BTC/USDT, ETH/USDT, BNB/USDT, ADA/USDT
- Paper Trading Mode: Test strategies safely before going live
- Comprehensive Logging: Detailed trade logs and performance tracking
- Docker Support: Easy containerized deployment
- CLI Interface: Full command-line control with status monitoring
EchoTrade/
βββ main.py # Main orchestration and CLI
βββ config.py # Configuration management
βββ signals.py # Signal fetching and simulation
βββ risk.py # Risk management and position sizing
βββ execution.py # Order execution with retry logic
βββ logger.py # Centralized logging
βββ tests/ # Comprehensive test suite
β βββ test_config.py
β βββ test_signals.py
β βββ test_risk.py # Includes test_risk_caps_loss
β βββ test_execution.py
βββ requirements.txt # Python dependencies
βββ Dockerfile # Container setup
βββ docker-compose.yml # Multi-service deployment
βββ .env.example # Configuration template
# Clone the repository
git clone <repository-url>
cd EchoTrade
# Install dependencies
pip install -r requirements.txt# Copy the environment template
cp .env.example .env
# Edit configuration (required for live trading)
nano .envKey configuration parameters:
BINANCE_API_KEY&BINANCE_API_SECRET: Your Binance API credentialsPORTFOLIO_VALUE: Starting portfolio value (default: $10,000)POSITION_SIZE_PERCENT: Position size as % of portfolio (default: 2%)STOP_LOSS_PERCENT: Stop loss percentage (default: 2%)MAX_DRAWDOWN_PERCENT: Maximum drawdown limit (default: 30%)
# Run in paper trading mode
python main.py --paper
# Run with debug logging
python main.py --paper --log-level DEBUG
# Run for limited iterations (testing)
python main.py --paper --max-iterations 10
# Check current status
python main.py --status# Run live trading (requires valid API keys)
python main.py
# Run in sandbox mode
SANDBOX_MODE=true python main.py# Build the image
docker build -t echotrade .
# Run in paper mode
docker run -d --name echotrade-bot \
--env-file .env \
-v $(pwd)/logs:/app/logs \
echotrade python main.py --paper# Start the bot
docker-compose up -d
# View logs
docker-compose logs -f echotrade
# Stop the bot
docker-compose down
# Start with monitoring (optional)
docker-compose --profile monitoring up -d
# Start with log aggregation (optional)
docker-compose --profile logging up -d- Yun Qiang: +1700% 30-day ROI, Priority 1
- Crypto Loby: +850% 30-day ROI, Priority 2
- Position Sizing: 2% of portfolio per trade
- Stop Loss: 2% below entry for long positions
- Max Drawdown: 30% portfolio drawdown limit
- Concurrent Positions: Maximum 5 positions
- Minimum Trade: $10 USDT minimum
- Market Data Analysis: Real-time price and volatility monitoring
- Signal Generation: Simulate high-ROI trader behavior
- Signal Strength: Aggregate signals by confidence and sentiment
- Risk Validation: Comprehensive pre-trade risk checks
- Order Execution: Market orders with stop-loss protection
Run the comprehensive test suite:
# Run all tests
pytest
# Run specific test categories
pytest tests/test_risk.py::TestRiskManager::test_risk_caps_loss
pytest tests/test_signals.py -v
pytest tests/test_execution.py -k paper_trading
# Run with coverage
pytest --cov=. --cov-report=htmlKey test coverage:
- β test_risk_caps_loss: Validates 30% drawdown limit enforcement
- β Risk management and position sizing
- β Signal generation and strength analysis
- β Order execution with retry logic
- β Paper trading simulation
logs/echotrade.log: Main application logslogs/trades.log: Trade-specific events- Console output with configurable levels
# Real-time status
python main.py --status
# Docker logs
docker-compose logs -f echotrade
# Trade events
tail -f logs/echotrade.log | grep "POSITION_"- Portfolio value and daily P&L
- Open positions and current drawdown
- Trade success rate and performance
- Risk limit adherence
| Parameter | Default | Description |
|---|---|---|
PORTFOLIO_VALUE |
10000 | Initial portfolio value (USDT) |
POSITION_SIZE_PERCENT |
2.0 | Position size as % of portfolio |
STOP_LOSS_PERCENT |
2.0 | Stop loss percentage |
MAX_DRAWDOWN_PERCENT |
30.0 | Maximum drawdown limit |
MIN_TRADE_AMOUNT |
10.0 | Minimum trade size (USDT) |
MAX_CONCURRENT_POSITIONS |
5 | Maximum open positions |
SIGNAL_CHECK_INTERVAL |
60 | Signal check frequency (seconds) |
SANDBOX_MODE |
true | Use Binance testnet |
-
API Key Security:
- Use Binance testnet for development
- Restrict API permissions (trading only, no withdrawal)
- Store keys in environment variables, never in code
-
Container Security:
- Runs as non-root user
- Minimal base image (python:3.12-slim)
- Read-only configuration mounts
-
Risk Management:
- Start with paper trading
- Use small portfolio values initially
- Monitor drawdown limits closely
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Run tests (
pytest) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Create an issue for bug reports
- Join our Discord for community support
- Check the wiki for advanced configuration
Disclaimer: This software is for educational purposes only. Trading cryptocurrencies carries significant financial risk. The authors are not responsible for any financial losses incurred through the use of this software.