Skip to content

Installation Guide

This guide provides step-by-step instructions for installing and setting up the Best Trading Bot (BTB).

Prerequisites

  • Python 3.10 or higher
  • Git
  • pip (Python package manager)

Basic Installation

  1. Clone the repository:
git clone https://github.com/gianlucamazza/btb-besttradingbot.git
cd btb-besttradingbot
  1. Create and activate a virtual environment:
# Create a virtual environment
python -m venv .venv

# Activate the virtual environment
# On macOS/Linux:
source .venv/bin/activate
# On Windows:
# .venv\Scripts\activate
  1. Install the required dependencies:
pip install -r requirements.txt
  1. Install the package in development mode:
pip install -e .

Installation with Development Dependencies

If you plan to contribute to the project, you'll need development dependencies as well:

pip install -e ".[dev]"

This installs additional dependencies such as: - pytest (for testing) - black (for code formatting) - ruff (for linting) - mypy (for type checking)

Setting Up API Access

To use the trading bot with real or test exchanges, you need to set up API credentials:

  1. Create a .env file in the project root directory:
cp .env.example .env
  1. Open the .env file and add your API credentials:
BYBIT_API_KEY=your_api_key_here
BYBIT_API_SECRET=your_api_secret_here
BYBIT_TESTNET=True  # Set to False for live trading

Verifying Installation

To verify that everything is installed correctly, run:

# Check CLI commands
btb --help

# Run a simple test
pytest tests/

Updating

To update to the latest version:

git pull
pip install -e .

Troubleshooting

If you encounter any issues during installation:

  • Make sure you have the correct Python version
  • Check that all dependencies are properly installed
  • Verify your API credentials if connecting to exchanges

For more detailed help, check the Configuration Guide or open an issue on GitHub.