- Python 3.7 or higher
- Binance Futures account with API access
- API key with futures trading permissions
- Clone the repository:
git clone <repository-url>
cd binance-bot- Install dependencies:
pip install -r requirements.txt- Set up environment variables: Copy the example environment file and configure your API credentials:
cp .env.example .env
# Edit .env with your actual Binance API credentialsThe bot supports various trading parameters that can be configured via command line arguments:
--symbol: Trading pair (e.g., BTCUSDC, ETHUSDC, PUMPUSDT)--quantity: Quantity per order (if you are trading ETHUSDC, then 0.1 means 0.1 ETH)--take_profit: Price offset for profit taking. 0.5 means placing close order for opening price + $0.5--max-orders: Maximum number of concurrent orders--wait-time: Wait time between orders (seconds)--direction: Trading direction (BUY or SELL)
python runbot.py --symbol BTCUSDC --quantity 0.001 --take_profit 50 --max-orders 50 --wait-time 30python runbot.py --symbol ETHUSDC --quantity 0.2 --take_profit 0.5 --max-orders 50 --wait-time 30| Argument | Description | Default | Example |
|---|---|---|---|
--symbol |
Trading pair symbol | ETHUSDC | BTCUSDC |
--quantity |
Order quantity | 0.01 | 0.02 |
--take_profit |
Price offset | 1 | 50 |
--max-orders |
Maximum concurrent orders | 75 | 5 |
--wait-time |
Wait time between orders (seconds) | 30 | 300 |
--direction |
Trading direction | BUY | SELL |
The bot includes a real-time dashboard for monitoring trading activities:
python dashboard.py- Real-time Account Monitoring: Live wallet balance, unrealized PnL, available balance
- Position Tracking: Monitor open positions with entry prices and mark prices
- Order Management: View all open orders with status and details
- Trading Statistics: Track total PnL, daily PnL, win rate, and trade counts
- Recent Trades: View the last 10 trades with realized PnL
- Connection Status: Monitor WebSocket connection and API status
# Monitor a specific symbol
python dashboard.py --symbol BTCUSDC
# Change refresh rate (default: 5 seconds)
python dashboard.py --refresh-rate 10
# Use API credentials from command line
python dashboard.py --api-key "your_key" --api-secret "your_secret"binance-scalping/
├── runbot.py # Main trading bot
├── dashboard.py # Real-time monitoring dashboard
├── requirements.txt # Python dependencies
├── .env.example # Environment variables template
├── .gitignore # Git ignore rules
├── LICENSE # MIT License
└── README.md # This file
- Order Placement: The bot places limit orders at random price levels
- Order Monitoring: WebSocket connection monitors order status in real-time
- Execution Handling: When an order is filled, the bot automatically places a closing order
- Risk Management: Configurable limits prevent excessive exposure
- TradingBot: Main bot logic and order management
- WebSocketManager: Real-time order and account updates
- BinanceClient: API interaction and order placement
- TradingLogger: Comprehensive logging and transaction tracking
- TradingDashboard: Real-time monitoring interface
- Bot places an POST-ONLY open order at QUEUE 1 price ± offset
- WebSocket monitors order status continuously
- When order fills, bot immediately places a closing limit order
- Process repeats based on wait time and max orders configuration
The bot provides comprehensive logging:
- Transaction Logs: CSV files with detailed trade information
- Activity Logs: Debug logs for troubleshooting
- Real-time Updates: Console output for immediate feedback
Log files are created per symbol:
{SYMBOL}_transactions_log.csv{SYMBOL}_bot_activity.log
- Environment Variables: API credentials are stored in environment variables, never hardcoded
- Secure Storage: Use
.envfile for local development (not committed to git) - Production: Use your system's environment variable management for production deployments
- WebSocket: All connections use secure WebSocket protocols (WSS)
- API Calls: All API calls use HTTPS with proper authentication
- Listen Key: Automatic refresh every 30 minutes to maintain secure connections
- No Sensitive Logging: API keys and secrets are never logged or displayed
- Transaction Logs: Only trade data is logged, no account credentials
- Error Handling: Sensitive information is masked in error messages
- Never commit
.envfiles - They're already in.gitignore - Use API keys with minimal permissions - Only futures trading permissions needed
- Regular key rotation - Consider rotating API keys periodically
- Test on testnet first - Always test with small amounts before live trading
- Monitor access logs - Check your Binance account for unusual activity
Copy .env.example to .env and fill in your credentials:
cp .env.example .env
# Edit .env with your actual API credentials- Test thoroughly on testnet before using real funds
- Start with small amounts
- Monitor the bot continuously
- Understand the trading strategy before deployment
For issues and questions:
- Check the logs for error messages
- Verify API credentials and permissions
- Test with small quantities first
- Monitor the dashboard for real-time status
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
If you discover a security vulnerability, please report it via email or create a private issue. Please do not create a public GitHub issue for security vulnerabilities.
This project is licensed under the MIT License - see the LICENSE file for details.
Disclaimer: This software is for educational purposes only. Use at your own risk. The authors are not responsible for any financial losses incurred from using this bot.