A lightweight command-line trading bot for Binance USDT-M Futures Testnet, written in Python with the python-binance SDK.
This project provides a simple interactive workflow for placing futures orders from the terminal while keeping the core trading actions encapsulated in a reusable BasicBot class.
- Place MARKET orders
- Place LIMIT orders
- Place STOP_MARKET orders (labeled as stop-limit in CLI flow)
- Input validation for order side and quantity
- File-based logging to
trading_bot.log - Basic exception handling for Binance API failures
- Python 3.7+
python-binance
- Visit the Binance Futures Testnet.
- Generate your API Key and API Secret.
pip install python-binancepython trading_bot.pyYou will be prompted for:
- API key and secret
- Symbol (for example,
BTCUSDT) - Order type (
market,limit,stop-limit) - Side (
buy/sell) - Quantity (and price fields where applicable)
Python-Binance-Bot/
├── trading_bot.py
├── README.md
└── LICENSE
The bot writes runtime logs to:
trading_bot.log
This includes initialization details, order attempts, API responses, and errors.
- Never share or commit your API credentials.
- Use testnet keys only unless you intentionally switch to live trading endpoints.
- Consider using environment variables or a secrets manager for production-grade key handling.
This project is intended for educational and testing purposes. Use at your own risk.