Overview
This multi-pairs martingale trading bot is designed for Binance exchange, supporting both spot and futures markets. Currently, it only implements long-position martingale strategies for strong-performing cryptocurrencies.
Important Note: Always test the code thoroughly before deployment. Conduct your own research as profitability is not guaranteed. The developers assume no responsibility for trading outcomes.
Installation Guide
Prerequisites
- Install Python 3.9+ (Anaconda recommended for environment management)
- Create a dedicated Python environment:
conda create -n mytrader python==3.9
conda activate mytraderSetup Process
- Download and extract the bot files
- Navigate to the project directory
- Install dependencies:
pip install -r requirements.txtAlternative manual installation:
pip install requests==2.29.0 apscheduler==3.10.1 pandas numpyConfiguration
Modify config.json (use config-example.json as template) with these parameters:
| Parameter | Description | Example Values |
|---|---|---|
platform | Exchange type | binance_spot or binance_future |
api_key | Binance API key | Your exchange API key |
max_pairs | Maximum concurrent trades | 4 |
pump_pct | 1-hour price surge threshold | 0.026 (2.6%) |
initial_trade_value | Base order size | 200 USDT |
trade_value_multiplier | Martingale coefficient | 1.5 |
See complete configuration details
Execution
- Local run:
python main.py - Server deployment (Linux):
nohup python -u main.py > nohup_log.out 2>&1 &👉 Recommended cloud server provider
Key Features
Dynamic Pair Selection: Identifies strong performers through:
- 1-hour price surges (
pump_pct) - 4-hour breakouts (
pump_pct_4h)
- 1-hour price surges (
Risk Management:
- Configurable stop-loss (
stop_loss_pct) - Profit-taking rules (
exit_profit_pct) - Position sizing controls
- Configurable stop-loss (
Custom Filters:
- Blocklist/unwanted pairs (
blocked_lists) - Allowlist/approved pairs (
allowed_lists)
- Blocklist/unwanted pairs (
Best Practices
- For spot trading: Maintain BNB balance for fee discounts
- Monitor server resources during extended runs
- Start with small trade values to test strategy performance
FAQ
What's the minimum account balance needed?
This depends on your initial_trade_value and max_pairs settings. For 4 pairs at $200 each, maintain at least $800 + buffer for volatility.
How often does the bot rebalance?
The strategy evaluates opportunities hourly based on price movements, but will maintain positions until exit conditions are met.
Can I run this alongside other strategies?
Yes, but ensure sufficient capital allocation and monitor for potential conflicts in order execution.
👉 Get started with crypto trading
Configuration Parameters
Detailed explanation of all config.json settings:
Platform Selection
binance_spotfor spot tradingbinance_futurefor derivatives
Trade Execution
taker_price_pct: Sets aggressiveness of orders (0.005 = 0.5% slippage allowance)
Risk Controls
max_increase_pos_count: Limits martingale cyclesturnover_threshold: Minimum liquidity requirement ($100,000 default)
Support
For technical assistance:
- Submit GitHub issues
- Contact developer via WeChat: bitquant51
Remember: Cryptocurrency trading involves substantial risk. Only use funds you can afford to lose.