Skip to content

qualitypro/bitbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– BitBot

Modular, adaptive crypto trading bot built on CCXT with real-time execution, risk management, and Telegram control.


๐Ÿš€ Overview

BitBot is a modular trading system designed for:

  • โš™๏ธ Clean architecture and maintainability
  • ๐Ÿ“ˆ Real-time market execution
  • ๐Ÿง  Strategy flexibility with RSI/SMA and predictive logic
  • ๐Ÿ” Secure configuration using .env
  • ๐Ÿ’ฌ Remote control via Telegram

โœจ Features

  • ๐Ÿ” Continuous trading loop with configurable intervals
  • ๐ŸŽฏ Dynamic Take-Profit / Stop-Loss (TP/SL)
  • ๐Ÿ“Š Volatility-aware trade logic
  • ๐Ÿง  RSI + SMA strategy engine
  • ๐Ÿ”ฎ Predictive trading mode
  • ๐Ÿ›ก๏ธ Risk management with reserve protection and trade limits
  • ๐Ÿ’ผ Portfolio tracking with drawdown monitoring
  • ๐Ÿงพ CSV trade logging
  • ๐Ÿ’ฌ Telegram command interface
  • ๐Ÿ”„ Hot config reload

Full feature list: see features.md


๐Ÿงฉ Architecture

bitbot/
โ”œโ”€โ”€ core/        # Trading engine, portfolio, risk management
โ”œโ”€โ”€ exchange/    # CCXT exchange integration layer
โ”œโ”€โ”€ strategy/    # Trading strategies
โ”œโ”€โ”€ services/    # Telegram integration and logging
โ”œโ”€โ”€ utils/       # Indicators, helpers, time utilities
โ”œโ”€โ”€ data/        # Trade logging and data handling
โ”œโ”€โ”€ config/      # Configuration loader
โ””โ”€โ”€ main.py      # Entry point

โš™๏ธ Installation & Quick Start

1. Clone the Repository

git clone https://github.com/qualitypro/bitbot.git
cd bitbot

2. Run BitBot

BitBot includes a helper script that automatically:

  • Creates a virtual environment
  • Installs dependencies
  • Generates config.json if missing
  • Generates .env if missing
  • Launches the bot
./run.sh

3. First-Time Setup

On first run, the script will create:

  • config.json from config.example.json
  • .env from env.example

Edit .env before running the bot with real credentials:

nano .env

Example .env:

BITMART_API_KEY=your_api_key
BITMART_API_SECRET=your_api_secret
BITMART_API_MEMO=your_api_memo

TELEGRAM_BOT_TOKEN=your_telegram_token
TELEGRAM_CHAT_ID=your_chat_id

After saving, run again:

./run.sh

โ–ถ๏ธ Manual Run

If you prefer to run without the helper script:

python main.py

๐Ÿงช Manual Setup

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python main.py

๐Ÿ’ฌ Telegram Commands

Command Description
/pause โธ Pause trading
/resume โ–ถ๏ธ Resume trading
/status ๐Ÿ“Š Show live status
/config ๐Ÿงพ Show safe configuration
/rebase ๐Ÿ”„ Reset TP/SL
/set key value โš™๏ธ Update config at runtime
/buy ๐Ÿ›’ Manual buy
/sell ๐Ÿ“‰ Manual sell
/portfolio ๐Ÿ’ผ Show portfolio value
/quote SYMBOL ๐Ÿ“ก Fetch market data
/lottery ๐ŸŽฏ Utility feature
/help โ“ Help menu

๐Ÿ” Security

  • API keys are stored in .env
  • config.json is ignored by Git
  • config.example.json is provided as a safe template
  • .gitignore protects local secrets and runtime files

Never commit real exchange keys, Telegram tokens, or production configuration files.


๐Ÿ“Š Example Output

๐Ÿ”— Trading Pair: SOL/USDT
๐Ÿ’ฐ Balances: 0.000000 SOL | 0.024555 USDT
๐Ÿ“ˆ Price: 67.376600
๐Ÿ“Š Volatility: 0.000473 | Prediction: hold
๐Ÿ”’ TP: 68.419600 | โš ๏ธ SL: 66.806000
โฑ Uptime: 0:00:03

๐Ÿง  Strategy

Default strategy:

  • RSI period: 14
  • SMA period: 20
  • Momentum crossover logic
  • Predictive mode configurable via config.json

๐Ÿ”Œ Exchange Support

BitBot is currently developed and tested using the BitMart exchange through CCXT.

Because the exchange layer is modular, BitBot can be adapted to other CCXT-supported centralized cryptocurrency exchanges, including:

  • Binance
  • Coinbase
  • Kraken
  • KuCoin
  • Other CCXT-compatible crypto exchanges

Note: Each exchange has different trading rules, including precision, minimum order size, rate limits, authentication, and symbol formats. Always test carefully before live trading.


๐Ÿ–ฅ๏ธ Environment Requirements

BitBot is designed to run in a lightweight Python environment with minimal dependencies.

Supported Environment

  • Operating System

    • Linux tested on Fedora
    • macOS should work
    • Windows via WSL recommended
  • Python Version

    • Python 3.9+
    • Python 3.10 or newer recommended
  • Package Manager

    • pip

Core Dependencies

Installed via requirements.txt:

  • ccxt โ€” exchange integration
  • requests โ€” HTTP communication
  • numpy โ€” indicators and calculations
  • python-dotenv โ€” environment variable management

System Requirements

  • Internet connection
  • Valid exchange API credentials
  • Optional Telegram bot token for remote control

๐Ÿ› ๏ธ Development

Run syntax checks:

python -m py_compile $(find . -name "*.py")

๐Ÿ—บ๏ธ Roadmap

  • Multi-pair trading
  • Trailing TP/SL
  • PostgreSQL trade logging
  • Dynamic web dashboard
  • Backtesting module
  • Strategy registry
  • Enterprise deployment profile

๐Ÿ“„ License

MIT License. See LICENSE.


โš ๏ธ Disclaimer

This software is for educational purposes only.

Cryptocurrency trading involves significant risk. Use at your own discretion. No financial advice is provided.


๐Ÿ‘ค Author

Michael Dietz GitHub: qualitypro


๐Ÿ’ก Built for adaptive, data-driven crypto trading.

About

Modular cryptocurrency trading engine with CCXT, Telegram control, and a clean architecture built for real-world and enterprise use.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors