Skip to content

saksham-program/AI-Powered-Finance-Chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Binance Futures Testnet Trading Bot (Python 3.10)

Command-line trading bot for Binance USDT-M Futures Testnet.

Why THis Project?

This project was built as part of a hiring assignment to demonstrate practical experience with Binance Futures APIs, order execution logic, and clean Python code structure. The focus is correctness, safety, and clear logging rather than strategy optimization.

Features

  • Class-based bot architecture (BasicBot)
  • Order types:
    • MARKET
    • LIMIT
    • STOP_LIMIT (stop + limit)
  • BUY / SELL
  • Strong input validation
  • Robust logging to logs/trading_bot.log
  • API keys loaded via environment variables (.env)

Prerequisites

Setup

1) Clone / unzip project

2) Create a virtual environment

python -m venv .venv
# Linux/Mac
source .venv/bin/activate
# Windows
.venv\\Scripts\\activate

3) Install dependencies

pip install -r requirements.txt

4) Configure environment variables

Copy .env.example to .env and fill in your testnet keys:

cp .env.example .env

Usage

Market order

python bot.py --symbol BTCUSDT --side BUY --type MARKET --qty 0.003

Limit order

python bot.py --symbol BTCUSDT --side BUY --type LIMIT --qty 0.003 --price 65000

Stop-Limit order

python bot.py --symbol BTCUSDT --side BUY --type STOP_LIMIT --qty 0.003 --stop 70000 --price 69800

Notes

  • This bot is TESTNET ONLY and points to https://testnet.binancefuture.com.
  • If you get precision errors (quantity/price step size), use the printed exchangeInfo hints in logs.

Logs

  • File: logs/trading_bot.log

Project Structure

.
├─ bot.py
├─ src/
│  ├─ bot.py
│  ├─ config.py
│  ├─ logger.py
│  ├─ validation.py
│  └─ __init__.py
├─ logs/
├─ requirements.txt
├─ .env.example
└─ README.md

About

CLI-based Python trading bot for Binance USDT-M Futures Testnet. Supports market, limit, and stop-limit orders with input validation, robust error handling, and detailed logging. Built for testing Futures API integration and order execution workflows.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages