A Python-based grid trading bot for MEXC exchange with a PyQt5 GUI interface.
- Configurable grid levels (1-1000000, defaults to 5)
- Dynamic price tracking - automatically follows current price up
- Grid spacing - customizable distance between orders
- Sell target - profit target above buy price
- Automatic order management - places sell orders when buy orders fill
- Trailing system - places new buy orders as price rises
- Continuous grid operation - automatically replaces buy orders after completed cycles
- Multi-instance safety - prevents duplicate orders when running multiple bot instances
- BTC price display on app launch and during operation
- Color-coded price changes (green=up, red=down)
- Enhanced logging - all activities visible in GUI and saved to files
- Log download - easily download all logs as ZIP archive
- Order tracking - monitor active orders and trade history
- Multi-language support (English/German)
- Settings persistence - saves configuration between sessions
- API key management - secure credential storage
- Export functionality - CSV export of trade history
- Download
GridBot_Windows_Updated.zip - Extract the zip file
- Double-click
GridBot.exeto run - Enter your MEXC API credentials
- Configure your grid settings
- Click "Start Bot"
# Clone the repository
git clone <repository-url>
cd GridBot
# Install dependencies
pip install -r requirements.txt
# Run the application
python main.pyStart Price: $118,985
Grid Levels: 5
Grid Spacing: $100
Sell Target: $500
Grid Levels:
1. Buy at $118,985 → Sell at $119,485
2. Buy at $118,885 → Sell at $119,385
3. Buy at $118,785 → Sell at $119,285
4. Buy at $118,685 → Sell at $119,185
5. Buy at $118,585 → Sell at $119,085
A cycle is completed when:
- Buy order fills at any grid level
- Sell order is automatically placed at
sell_targetabove buy price - Sell order fills, completing the round trip
- Profit = (sell_price - buy_price) × amount
- All bot activities are automatically logged to files
- Logs are saved in the
logs/directory with timestamps - Each session creates a new log file
- Logs include timestamps, log levels, and detailed messages
- Click the "📥 Download All Logs" button in the GUI
- Choose where to save the ZIP archive
- Archive contains all log files with timestamps
- Useful for debugging and support purposes
- Create a MEXC account
- Generate API key and secret
- Enter credentials in the app
- Save API keys
- Grid Levels: Number of buy orders per grid level (1-1000000)
- Grid Spacing: Distance between buy orders ($)
- Position Size: Amount of BTC per order
- Sell Target: Profit target above buy price ($)
- Dynamic Tracking: Automatically follows current price up
# Install Wine (if not already installed)
sudo apt install wine64
# Build Windows executable
python3 build_windows_cross.py
# Create distribution package
python3 create_windows_package.pydist/GridBot.exe- Native Windows executabledist/GridBot_Windows/- Complete distribution packagedist/GridBot_Windows_Updated.zip- Ready for distribution
GridBot/
├── api/ # MEXC API integration
├── bot/ # Trading bot logic
├── config/ # Configuration management
├── gui/ # PyQt5 GUI components
├── utils/ # Database and utilities
├── main.py # Application entry point
├── build_windows_cross.py # Windows build script
├── create_windows_package.py # Package creation script
└── requirements.txt # Python dependencies
- API credentials are stored locally in
settings.json - No credentials are transmitted except to MEXC API
- All trading logic runs locally on your machine
This software is for educational and personal use only. Trading cryptocurrencies involves significant risk. Use at your own discretion and never risk more than you can afford to lose.
This project is provided as-is for educational purposes.
- "Insufficient funds" - Add USDT to your MEXC account
- API errors - Verify your API key and secret
- Wine crashes - Normal when testing on Linux, works fine on Windows
- Price not updating - Check internet connection and API status
- Check the log area for detailed error messages
- Verify your MEXC account has sufficient funds
- Ensure API keys have trading permissions