Skip to content

LeaderMalang/mexc_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

MEXC Trading Bot with TP/SL and Ultra-Low Latency (5 ms )

This bot automatically buys a newly listed token on MEXC at release time and monitors for Take Profit (TP) and Stop Loss (SL) conditions. Designed for sub-5ms latency, this bot is optimized for real-time execution when hosted on cloud platforms like AWS EC2 (Singapore).


⚙️ Features

  • ✅ Async HTTP requests using httpx (low latency)
  • ✅ Full MEXC Spot API compliance
  • ✅ Manual input for:
    • Trading symbol
    • UK-based release time
    • Take Profit price
    • Stop Loss price
  • ✅ Real-time ticker monitoring
  • ✅ Automatic Market Buy & Market Sell

🧾 Requirements

  • Python 3.9+
  • MEXC Spot Trading API key and secret
  • Internet connection

📦 Install Dependencies

pip install httpx pytz

🔐 Environment Variables (Optional)

Create a .env file (recommended for production):

MEXC_API_KEY=your_api_key_here
MEXC_API_SECRET=your_api_secret_here

Or export them manually:

export MEXC_API_KEY=your_api_key_here
export MEXC_API_SECRET=your_api_secret_here

🚀 Usage

Run the script:

python main.py

Input when prompted:

  1. Symbol: e.g., ABCUSDT
  2. UK Release Time: Format YYYY-MM-DD HH:MM
  3. TP: Take Profit (e.g., 0.055)
  4. SL: Stop Loss (e.g., 0.030)

Bot will:

  • Wait till release
  • Poll until token becomes tradable
  • Execute market buy (20 USDT default)
  • Monitor TP/SL to sell automatically

📍 Deployment Recommendation

  • Use AWS EC2 (Singapore region)
  • Instance type: t4g.small or higher
  • Add NTP sync for precise execution
  • Optional: Wrap in Docker container for stability

Disclaimer: This script interacts with real funds. Use cautiously and at your own risk.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages