A complete, clean, and modular Python bot for interacting with the Binance Futures Testnet API. It supports placing MARKET and LIMIT orders, validating user inputs, and robust logging.
- Futures Testnet Integration: Safely test your trading strategies with paper money.
- Market & Limit Orders: Support for both BUY and SELL sides.
- Interactive CLI: Easy-to-use command-line interface to place orders.
- Input Validation: Ensures order inputs are correct before sending to the exchange.
- Comprehensive Logging: All activities and errors are logged to
logs/trading.logand the terminal.
-
Clone the repository: (Or navigate to this project's root directory)
-
Create a virtual environment (Optional but recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up API Keys:
- Go to Binance Futures Testnet and register/login.
- Generate API keys in the testnet dashboard.
- Copy
.env.exampleto a new file named.env:cp .env.example .env
- Edit
.envand insert your actualBINANCE_API_KEYandBINANCE_API_SECRET.
Run the CLI application:
python cli.pyFollow the interactive prompts to place your orders!
bot/client.py: Handles connection to the Binance Testnet.bot/orders.py: Contains logic for placing MARKET and LIMIT orders.bot/validators.py: Reusable input validation functions.bot/logging_config.py: Logger setup.cli.py: Main entry point for the interactive terminal.