System requirements
- Rust: Latest stable toolchain (1.70+)
- Python: 3.8 or higher (for Python bindings)
- Operating systems: Linux, macOS, Windows
Rust installation
Use GlowBack as a Rust library in your Cargo project.Build the workspace
Build all crates:This compiles all core crates:
gb-types- Core types, orders, portfolio, strategiesgb-data- Data ingestion and storagegb-engine- Backtesting enginegb-python- Python bindingsgb-risk- Risk analyticsgb-optimizer- Parameter optimization
Using GlowBack crates
Add GlowBack crates to yourCargo.toml:
Python installation
Install the Python bindings to use GlowBack from Python.Install Python dependencies
GlowBack requires Python 3.8 or higher. Verify your version:If you need to upgrade, use your system’s package manager or download from python.org.
Install Rust (required for building)
The Python bindings require Rust to build. If you haven’t installed it:
Clone and build Python bindings
maturin develop builds and installs the package in development mode, making it available to import as glowback.Alternative: Using pip (when published)
When available, you’ll be able to install via pip:Docker installation
Run GlowBack services with Docker for a zero-configuration setup.Install Docker
Install Docker and Docker Compose:
- Linux: Follow Docker’s official guide
- macOS/Windows: Install Docker Desktop
Launch with Docker Compose
Build and start all services:This starts three services:
- Engine: Rust backtesting engine on port 8081
- API: FastAPI gateway on port 8000
- UI: Streamlit interface on port 8501
Access the services
Once running, access:
- UI: Open http://localhost:8501 in your browser
- API: http://localhost:8000/docs for Swagger documentation
- Engine: http://localhost:8081/health for health check
Docker configuration
Customize behavior with environment variables:docker-compose.yml configuration:
Streamlit UI setup
Run the Streamlit interface for interactive strategy development.Install Python dependencies
Navigate to the UI directory:Install required packages:Required packages:
streamlit>=1.35.0plotly>=5.17.0pandas>=2.1.0numpy>=1.24.0python-dateutil>=2.8.2requests>=2.31.0streamlit-ace>=0.1.1streamlit-option-menu>=0.3.6
Launch the UI
The easiest way to start:This script:
- Installs dependencies if needed
- Checks for Rust bindings
- Launches Streamlit at
http://localhost:8501
Verify the UI is running
Open http://localhost:8501 in your browser. You should see the GlowBack interface with navigation:
- Data Loader
- Strategy Editor
- Backtest Runner
- Results Dashboard
- Portfolio Analyzer
- Advanced Analytics
Running examples
GlowBack includes example code to help you get started.Rust examples
basic_usage example demonstrates:
- Creating symbols and market data
- Using the cache system
- Portfolio management
- Strategy framework
- All four built-in strategies
Python examples
Create a fileexample.py:
Troubleshooting
Rust build errors
If you encounter build errors:-
Update Rust: Ensure you have the latest stable version
-
Clean build: Remove build artifacts and rebuild
-
Check toolchain: Verify the correct toolchain is active
Python import errors
Ifimport glowback fails:
-
Rebuild bindings: Ensure maturin build completed
-
Check Python version: GlowBack requires Python 3.8+
-
Virtual environment: Consider using a virtual environment
Docker issues
If Docker services fail to start:-
Check Docker daemon: Ensure Docker is running
-
Port conflicts: Verify ports 8000, 8081, 8501 are available
-
View logs: Check service logs for errors
Streamlit UI issues
If the UI doesn’t load:-
Check dependencies: Reinstall requirements
-
Port in use: Try a different port
-
Clear cache: Remove Streamlit cache
Development setup
For contributing or advanced development:What’s next?
Quickstart
Run your first backtest in minutes
Core concepts
Learn the fundamentals of GlowBack
Strategy development
Create custom trading strategies
API reference
Explore the complete API