Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Binance Futures Testnet Trading Bot

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.

Features

  • 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.log and the terminal.

Setup Instructions

  1. Clone the repository: (Or navigate to this project's root directory)

  2. Create a virtual environment (Optional but recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Set up API Keys:

    • Go to Binance Futures Testnet and register/login.
    • Generate API keys in the testnet dashboard.
    • Copy .env.example to a new file named .env:
      cp .env.example .env
    • Edit .env and insert your actual BINANCE_API_KEY and BINANCE_API_SECRET.

Running the Bot

Run the CLI application:

python cli.py

Follow the interactive prompts to place your orders!

Project Structure

  • 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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages