Skip to content

Repository files navigation

CryptoAlpha: Multi-Model Quant Engine

Python 3.10+

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.


📈 System Architecture

The engine operates on a multi-layer alpha generation pipeline:

  1. Regime Detection: A 4-state HMM classifies market structure (Bull, Bear, Volatile, Stress).
  2. Cross-Asset Connectivity: A GNN propagates alpha signals through a correlation-based neighborhood graph.
  3. Alpha Prediction: Stacked XGBoost and LightGBM models target 15-minute price movements.
  4. 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]
Loading

🛠️ Installation

# 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 .env

📂 Project Structure

  • src/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.

📜 Development Story: The LLM Quant Experiment

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.

⚠️ Disclaimer

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.

About

I wanted to experiment with quant + ML concepts using LLM , so I built this project that downloads Binance data and tested with different models. explore it and see if you can find any edge or alpha by tweaking the code.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages