Skip to content

Deepesh004/Simplified_training_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Binance Futures Testnet Trading Bot

Project Overview

A production-ready Python trading bot for Binance Futures Testnet (USDT-M) that supports MARKET and LIMIT orders for BUY/SELL sides via CLI.

Project Structure

trading_bot/
├── bot/
│   ├── __init__.py
│   ├── client.py
│   ├── orders.py
│   ├── validators.py
│   ├── logging_config.py
│   └── cli.py
├── requirements.txt
├── README.md
└── logs/
    └── trading_bot.log

Setup Instructions

  1. Clone/Navigate to project directory

    cd "c:/Projects/Machine learning/Simplified Trading Bot/trading_bot"
  2. Install dependencies

    pip install -r requirements.txt
  3. Set Environment Variables (create .env file or set in system)

    BINANCE_API_KEY=your_testnet_api_key
    BINANCE_API_SECRET=your_testnet_secret
    

    Get testnet keys from: https://testnet.binancefuture.com

  4. Create logs directory

    mkdir logs

Usage Examples

MARKET Order (BUY BTCUSDT)

python bot/cli.py BTCUSDT BUY MARKET 0.001

Example Output:

Order Request Summary:
Symbol: BTCUSDT
Side: BUY
Type: MARKET
Quantity: 0.001
Price: N/A

Order Response:
Order ID: 123456789
Status: FILLED
Executed Qty: 0.001
Avg Price: 43210.50
Success: Order placed successfully!

LIMIT Order (SELL BTCUSDT)

python bot/cli.py BTCUSDT SELL LIMIT 0.001 43000

Example Output:

Order Request Summary:
Symbol: BTCUSDT
Side: SELL
Type: LIMIT
Quantity: 0.001
Price: 43000

Order Response:
Order ID: 987654321
Status: NEW
Executed Qty: 0.000
Avg Price: 0.0
Success: Order placed successfully!

Example Log Output (logs/trading_bot.log)

2024-01-15 10:30:45,123 - INFO - CLI: Starting trading bot with args: BTCUSDT BUY MARKET 0.001
2024-01-15 10:30:45,125 - INFO - Validators: Validated symbol: BTCUSDT
2024-01-15 10:30:45,456 - INFO - Client: Placing MARKET BUY order for BTCUSDT, qty: 0.001
2024-01-15 10:30:45,789 - INFO - Orders: Order successful - ID: 123456789, Status: FILLED

Features

  • ✅ MARKET & LIMIT orders
  • ✅ BUY & SELL support
  • ✅ Input validation
  • ✅ Comprehensive logging
  • ✅ Error handling
  • ✅ Binance Futures Testnet
  • ✅ Production-ready code structure

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages