An quantitative trading framework for cryptocurrency markets, utilizing a hybrid stack of Hidden Markov Models (HMM), Graph Neural Networks (GNN), and Stacked Machine Learning Ensembles.
The engine operates on a multi-layer alpha generation pipeline:
- Regime Detection: A 4-state HMM classifies market structure (Bull, Bear, Volatile, Stress).
- Cross-Asset Connectivity: A GNN propagates alpha signals through a correlation-based neighborhood graph.
- Alpha Prediction: Stacked XGBoost and LightGBM models target 15-minute price movements.
- Sequential Filtering: Markov Chain sequence analysis filters for high-probability "Natural Frequency" entries.
graph TD
A[Binance / Macro Data] --> B[Feature Engineering]
B --> C[HMM Regime Classifier]
C --> D[GNN Neighborhood Alpha]
D --> E[Ensemble Prediction]
E --> F[Markov Chain Filter]
F --> G[Execution: Futures Contracts]
# Clone the repository
git clone https://github.com/Dhruvil-8/CryptoAlpha.git
cd CryptoAlpha
# Install in editable mode
pip install -e .
# Configure environment
cp .env.example .envsrc/features/: Standardized alpha factors and Markov transitions.src/regime/: HMM training and real-time state detection.src/models/: XGBoost/LGBM ensemble and GNN propagation logic.src/backtest/: Multi-timeframe simulation engine with realistic cost modeling.src/live/: Real-time inference monitor for CoinDCX/Binance.
This project is a unique experiment in Automated Quant Strategy Generation.
- The Seed (Phase 1): Initial planning and prototype code were generated using ChatGPT 5.2.
- The Evolution (Phase 2): Advanced features—including GNN Lead-Lag graphs, Hidden Markov Models, and Multi-Timeframe Resamplers—were implemented using the Antigravity AI Agentinc IDE by Google
- Human-Agent Synergy: The entire codebase was built, debugged, and optimized by the Antigravity agent through a continuous feedback loop and iterative prompting.
This repository serves as a benchmark for how humans and AI agents can co-author complex, multi-model financial engineering platforms.
This is purely for educational and experimental purposes.
- It constitutes an LLM experiment and cannot be used for trading Real money.
- The authors assume no responsibility for financial losses or market outcomes.