A comprehensive, production-ready quantitative analysis system with multi-asset support, advanced portfolio optimization, and extensive backtesting capabilities.
- Stocks: Individual stocks, ETFs, indices (5 specialized TraderFox portfolios)
- Forex: 72+ major, minor, and exotic currency pairs
- Crypto: 220+ Bybit perpetual futures with real-time data
- Commodities: 46+ CFD/rolling futures contracts
- Bonds: 30+ government and corporate bond ETFs
- Indices: 114+ global country and sector ETFs
- Yahoo Finance (Free, no API key required)
- Alpha Vantage (Stock/Forex/Crypto data)
- Twelve Data (Multi-asset financial data)
- Polygon.io (Real-time market data)
- Tiingo (Stock and ETF data)
- Finnhub (Market data)
- Bybit (Crypto derivatives)
- Pandas DataReader (Economic data)
- 5 Specialized TraderFox Portfolios:
- German DAX/MDAX stocks (130 symbols)
- US Technology sector (275 symbols)
- US Healthcare/Biotech (450 symbols)
- US Financials (185 symbols)
- European blue chips (95 symbols)
All functionality accessible through a single command interface:
# Portfolio Testing
poetry run python -m src.cli.unified_cli portfolio test-all --portfolio config/portfolios/crypto.json --metric sharpe_ratio --period max --test-timeframes --open-browser
# Data Management
poetry run python -m src.cli.unified_cli data download --symbols BTC-USD,ETH-USD --start-date 2023-01-01 --source bybit
# Cache Management
poetry run python -m src.cli.unified_cli cache stats
poetry run python -m src.cli.unified_cli cache clear
# Report Generation
poetry run python -m src.cli.unified_cli reports organize
Automatic symbol format conversion between data sources:
- Yahoo Finance:
EURUSD=X
- Twelve Data:
EUR/USD
- Bybit:
BTCUSDT
- Polygon:
BTC-USD
- HTML Portfolio Reports with Plotly charts
- Performance Analytics with risk metrics
- Comparison Analysis across strategies and timeframes
- Auto-opening browser for immediate visualization
Complete containerization with docker-compose:
- Production deployment
- Development environment
- Testing environment
- Jupyter Lab for analysis
- API service
- Database (PostgreSQL)
- Caching (Redis)
- Monitoring (Prometheus + Grafana)
- Python 3.12+
- Poetry
- Docker (optional)
-
Clone the repository:
git clone https://github.com/LouisLetcher/quant-system.git cd quant-system
-
Install dependencies:
poetry install
-
Set up environment variables:
cp .env.example .env # Edit .env with your API keys
-
Test the system:
poetry run python -m src.cli.unified_cli cache stats
Test a cryptocurrency portfolio:
poetry run python -m src.cli.unified_cli portfolio test-all \
--portfolio config/portfolios/crypto.json \
--metric sharpe_ratio \
--period max \
--test-timeframes \
--open-browser
Download forex data:
poetry run python -m src.cli.unified_cli data download \
--symbols EURUSD=X,GBPUSD=X \
--start-date 2023-01-01 \
--end-date 2024-01-01 \
--source twelve_data
Analyze German DAX stocks:
poetry run python -m src.cli.unified_cli portfolio test-all \
--portfolio config/portfolios/stocks_traderfox_dax.json \
--metric sortino_ratio \
--period 1y \
--test-timeframes
quant-system/
βββ src/
β βββ core/ # Unified system core
β β βββ data_manager.py # Multi-source data management
β β βββ backtest_engine.py # Unified backtesting
β β βββ cache_manager.py # Intelligent caching
β βββ cli/ # Command-line interface
β β βββ unified_cli.py # Main CLI entry point
β βββ reporting/ # Report generation
β βββ portfolio/ # Portfolio optimization
β βββ utils/ # Utilities
βββ config/
β βββ portfolios/ # Portfolio configurations
β β βββ crypto.json # Crypto futures
β β βββ forex.json # Currency pairs
β β βββ bonds.json # Fixed income
β β βββ commodities.json # Commodity CFDs
β β βββ indices.json # Global indices
β β βββ stocks_traderfox_*.json # TraderFox stocks
β βββ optimization_config.json
βββ docs/ # Documentation
βββ tests/ # Test suite
βββ docker-compose.yml # Container orchestration
βββ Dockerfile # Container definition
βββ pyproject.toml # Dependencies
Each portfolio is defined in JSON format with:
- symbols: List of trading instruments
- data_sources: Primary and fallback data sources
- intervals: Supported timeframes
- risk_parameters: Position sizing and risk management
- optimization: Strategy and metric preferences
Example:
{
"crypto": {
"name": "Crypto Portfolio",
"symbols": ["BTCUSDT", "ETHUSDT", ...],
"data_sources": {
"primary": ["bybit", "polygon", "twelve_data"],
"fallback": ["alpha_vantage", "yahoo_finance"]
},
"intervals": ["1m", "5m", "15m", "30m", "1h", "4h", "1d", "1w"],
"risk_profile": "high",
"leverage": 10
}
}
Required API keys and configuration:
# Data Sources
ALPHA_VANTAGE_API_KEY=your_key
TWELVE_DATA_API_KEY=your_key
POLYGON_API_KEY=your_key
BYBIT_API_KEY=your_key
BYBIT_API_SECRET=your_secret
# System Configuration
CACHE_ENABLED=true
CACHE_DURATION_HOURS=24
# Run production system
docker-compose up quant-system
# Run with full stack
docker-compose --profile database --profile api --profile monitoring up
dev
: Development environmenttest
: Testing environmentapi
: Web API servicedatabase
: PostgreSQL databasecache
: Redis cachingmonitoring
: Prometheus + Grafanajupyter
: Jupyter Lab analysis
Bybit perpetual futures covering:
- Major cryptocurrencies (BTC, ETH, etc.)
- DeFi tokens
- Layer 1/2 protocols
- Meme coins
- Emerging altcoins
Complete currency coverage:
- Major pairs (EUR/USD, GBP/USD, etc.)
- Minor pairs (cross currencies)
- Exotic pairs (emerging markets)
Research-based stock selection:
- German DAX: SAP, Siemens, BMW, etc.
- US Tech: FAANG, semiconductors, software
- US Healthcare: Pharma, biotech, devices
- US Financials: Banks, fintech, insurance
- European: ASML, NestlΓ©, LVMH, etc.
Fixed income diversification:
- Government bonds (US, international)
- Corporate bonds
- TIPS (inflation-protected)
- Municipal bonds
Direct commodity exposure:
- Precious metals (Gold, Silver, Platinum)
- Energy (Oil, Natural Gas, Coal)
- Agriculture (Wheat, Corn, Coffee)
- Industrial metals (Copper, Aluminum)
Global market coverage:
- Country-specific ETFs
- Sector ETFs
- Factor-based ETFs
- Regional groupings
# Run all tests with coverage
pytest
# Run only unit tests
pytest -m "not integration"
# Run only integration tests
pytest -m "integration"
# Run tests with verbose output
pytest -v
# Run specific test file
pytest tests/test_data_manager.py
# Run tests in parallel
pytest -n auto
# Format code
poetry run black .
# Sort imports
poetry run isort .
# Lint code
poetry run ruff check .
# Pre-commit checks (aligned with CI)
pre-commit run --all-files
# Install dependencies with dev tools
poetry install --with dev
# Activate virtual environment
poetry shell
# Install pre-commit hooks
pre-commit install
# Build package
poetry build
- Essential checks: Format, lint, test, build on every push/PR
- GitHub native features: CodeQL security scanning, Dependabot dependency updates
- Automated releases: GitHub releases with artifacts on tags
- KISS principle: Minimal, focused workflows leveraging GitHub's built-in capabilities
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: Check the
docs/
directory - Issues: Open a GitHub issue
- Discord: Join our trading community
- Repository: https://github.com/LouisLetcher/quant-system
- Documentation: https://LouisLetcher.github.io/quant-system
- Docker Hub: https://hub.docker.com/r/LouisLetcher/quant-system
β‘ Built for speed, designed for scale, optimized for profit.