Name: Dev Suthar
Date: 02/10/2025
Project: Simplified Trading Bot
I developed a CLI-based trading bot for Binance USDT-M Futures Testnet that supports the following features:
- ✅ Market Orders
- ✅ Limit Orders
- ✅ OCO Orders (Bonus)
- ✅ Input Validation & Error Handling
- ✅ Comprehensive Logging
- ✅ Test Mode for Safe Testing
- 
Install Dependencies 
 Run the following command to install the necessary dependencies:pip install python-binance python-dotenv flask flask-cors 
- 
Setup API Keys 
 Create a.envfile and add your Binance API credentials:echo "API_KEY=f9e7faab0b4873c0908b5c42b24fabe81534fc1400b34d5c1b6bade0b1db0f87" > .env echo "API_SECRET=c51f76b6c0fe156d03dfdfd34dfde2df18c2f90325ac73a76109d1c49b8fdf2c" >> .env 
- 
Run the Bot 
 Clone the repository and run the Flask app:git clone https://github.com/Devredhat/dev-binance-bot.git cd dev-binance-bot cd src cd frontend python app.py After that, open the web interface in your browser: http://localhost:5000
- 
Market Orders python src/market_orders.py BTCUSDT BUY 0.001 --test 
- 
Limit Orders python src/limit_orders.py BTCUSDT BUY 0.001 50000 --test 
- 
OCO Orders (Bonus) python src/advanced/oco.py BTCUSDT BUY 0.001 52000 48000 47500 --test 
binance-bot/
├── src/                          # Core trading engine
│   ├── bot_base.py               # Base class with API client
│   ├── market_orders.py          # Market order implementation
│   ├── limit_orders.py           # Limit order implementation
│   └── advanced/
│       └── oco.py                # OCO order implementation
├── frontend/                     # Web interface
│   ├── app.py                    # Flask server
│   ├── index.html                # Main interface
│   ├── style.css                 # Professional styling
│   └── script.js                 # Interactive functionality
├── bot.log                       # Auto-generated logs
├── .env                          # API credentials (create this)
├── requirements.txt              # Python dependencies
└── README.md                     # This file
- ✅ Market & Limit Orders
- ✅ OCO Orders (Take-profit + Stop-loss)
- ✅ Web Interface + CLI
- ✅ Test Mode (--testflag)
- ✅ Real-time Logging
- Use the --testflag to perform safe testing without executing real trades.
- Check bot.logfor detailed logs and debugging information.
- Web UI:
 After opening the Flask app (http://localhost:5000), click the "Connect" button to connect your Binance account and place orders.
- You can obtain Binance Testnet API keys from Binance Futures Testnet.