Skip to content

Installation & Setup

Requirements

  • Python 3.11+ (Python 3.12 recommended)

Quick Installation

Basic Installation

# Install from GitHub
pip install git+https://github.com/cracktrader/cracktrader.git

Development Installation

For developers who want to contribute or modify the code:

# Clone the repository
git clone https://github.com/cracktrader/cracktrader.git
cd cracktrader

# Development setup (recommended)
make setup

# Or manual setup
pip install -e ".[dev,web,docs]"
pre-commit install

Development Requirements: - Git for version control - Make (optional, for development workflow)

Installation Options

Cracktrader supports optional extras that can be installed alongside the core package:

# Core installation (trading only)
pip install git+https://github.com/cracktrader/cracktrader.git

# With web interface
pip install "git+https://github.com/cracktrader/cracktrader.git[web]"

# With multiple extras
pip install "git+https://github.com/cracktrader/cracktrader.git[web,docs]"

Available Extras:

  • web - FastAPI REST API server, WebSocket streams, React dashboard
  • docs - MkDocs documentation system, API reference generation
  • dev - Testing framework, code quality tools, pre-commit hooks
  • performance - Benchmark suite, memory profiling tools
  • test - Testing dependencies only

Verification

Test your installation:

# Test basic functionality
python -c "import cracktrader; print('Cracktrader installed successfully')"

# Test exchange connectivity
python -c "import ccxt; print('CCXT working:', ccxt.exchanges[:5])"

For Development Installation:

# Run example strategy (requires cloned repository)
python examples/basic_strategy.py

# Run tests
make test

Configuration

API Keys Setup

For live trading, configure exchange API keys:

# Create configuration directory
mkdir -p ~/.config/cracktrader

# Create config file
cat > ~/.config/cracktrader/config.yaml << EOF
exchanges:
  binance:
    sandbox:
      apiKey: "your_sandbox_api_key"
      secret: "your_sandbox_secret"
      sandbox: true
    live:
      apiKey: "your_live_api_key"
      secret: "your_live_secret"
      sandbox: false
EOF

# Secure the config file
chmod 600 ~/.config/cracktrader/config.yaml

Environment Variables

Alternatively, use environment variables:

export CRACKTRADER_BINANCE_API_KEY="your_api_key"
export CRACKTRADER_BINANCE_SECRET="your_secret"
export CRACKTRADER_SANDBOX=true  # Use sandbox by default

Troubleshooting

Common Issues

Import errors:

# Ensure you're in the right Python environment
python -c "import sys; print(sys.executable)"

# Reinstall in development mode
pip install -e .

Permission errors:

# On macOS/Linux, you might need:
sudo pip install cracktrader

# Better: use virtual environment
python -m venv .venv
source .venv/bin/activate  # or `.venv\Scripts\activate` on Windows
pip install git+https://github.com/cracktrader/cracktrader.git

Exchange connection issues:

# Test exchange connectivity
python -c "
import ccxt
exchange = ccxt.binance({'sandbox': True})
print(exchange.fetch_ticker('BTC/USDT'))
"

Getting Help

Next Steps