A robust, regime-adaptive QQQ trading strategy utilizing ensemble machine learning and options market microstructure signals (GEX, VRP, Skew).
QQQ Options Alpha Research
Forecasting QQQ with its Own Options Data: A Ensemble Machine Learning Approach
This repository contains a robust, production-ready trading strategy that uses end-of-day QQQ options data to forecast next-day directional movement and generate daily trading signals with leverage between -1.0x and +1.5x.
๐ฏ Objective
Design a model that systematically deciphers sentiment, risk appetite, and positioning embedded within the QQQ options market to gain an edge on future price action.
Key Performance Target:
- Calmar Ratio > 2.0 (Risk-adjusted returns)
- Robustness: Strategy stable to ยฑ10% parameter variations
- Leverage Range: -1.0x (full short) to +1.5x (leveraged long)
๐ Results Summary
Test Set Performance (2024-07-26 to 2025-09-17)
| Metric | Value | |--------|-------| | Calmar Ratio | 2.14 โ | | Sharpe Ratio | 1.92 | | Total Return | 23.5% | | Max Drawdown | -13.7% | | Win Rate | ~55% |
Robustness Check: Strategy maintains Calmar > 1.5 across all parameter variations (ยฑ10%).
๐๏ธ Repository Structure
qqq-options-alpha-research/
โโโ data/
โ โโโ optionseodQQQ.csv # Raw options data (>5M rows)
โ โโโ daily_features.parquet # Preprocessed features (generated)
โโโ notebooks/
โ โโโ eda.ipynb # Feature engineering & EDA (NEW - Modular)
โ โโโ model.ipynb # Model training & evaluation (NEW - Modular)
โโโ src/
โ โโโ feature_engineering.py # Robust feature generation (100+ features)
โ โโโ ensemble_model.py # Ensemble ML model (LightGBM + XGBoost + RF + Ridge)
โ โโโ visualization.py # Plotting utilities (NEW)
โ โโโ backtesting.py # Performance metrics & robustness testing (NEW)
โโโ docs/
โ โโโ strategy_logic.md # Detailed strategy rationale
โ โโโ feature_engineering.md # Feature descriptions
โ โโโ methodology.md # Model methodology & assumptions
โโโ outputs/ # Generated results & plots
โโโ environment.yml # Conda environment configuration
โโโ README.md # This file
โโโ .gitignore # Git ignore rules
๐ Quick Start
1. Setup Environment
# Clone repository
git clone https://github.com/SMalaekeh/qqq-options-alpha-research.git
cd qqq-options-alpha-research
Create conda environment (recommended)
conda env create -f environment.yml
conda activate qqq-options-alpha
OR install dependencies with pip
pip install pandas numpy scikit-learn lightgbm xgboost matplotlib seaborn jupyter notebook ipykernel pyarrow
2. Run Feature Engineering
# Open and run eda.ipynb
jupyter notebook notebooks/eda.ipynb
This will:
- Load raw options data
- Generate 100+ features including:
- Save features to
data/daily_features.parquet
3. Train & Evaluate Model
# Open and run model.ipynb
jupyter notebook notebooks/model.ipynb
This will:
- Train ensemble model (LightGBM + XGBoost + RF + Ridge)
- Generate trading signals with volatility targeting
- Evaluate performance (Sharpe, Calmar, drawdown)
- Run robustness analysis
๐ Strategy Overview
Core Philosophy
The options market is a sentiment barometer and positioning indicator. Large institutional traders must hedge their positions, creating predictable flows. By analyzing these flows and implied volatility dynamics, we can forecast short-term QQQ movements.
Key Signals
- Variance Risk Premium (VRP)
- Gamma Exposure (GEX)
- Put/Call Ratios
- Volatility Skew
Model Architecture
Why Ensemble Trees over Deep Learning and aggressive hyperparameter optimization using Optuna?
During the R&D phase, I conducted extensive experiments comparing Deep Learning architectures against Tree-based Ensembles.- Deep Learning Experiments: I implemented Transformer encoders (for attention mechanisms on volatility surfaces) and LSTM networks to capture sequential dependencies.
- The Findings: While DL models achieved high training accuracy, they suffered from significant variance in the test set. Given the noise-to-signal ratio in financial data, the DL models tended to overfit to specific market regimes.
- The Decision: I selected an Ensemble Approach (LightGBM + XGBoost + Random Forest + Ridge).
Ensemble Approach:
- LightGBM (30%): Fast gradient boosting for feature interactions
- XGBoost (30%): Robust gradient boosting with regularization
- Random Forest (30%): Bagging for stability
- Ridge Regression (10%): Linear anchor to prevent overfitting
- Raw predictions โ EMA smoothing (reduce noise)
- Volatility targeting (scale positions by realized vol)
- Regime filter (reduce/eliminate positions during crises)
- Leverage capped at -1.0x to +1.5x
- Kill switch: Go to cash if vol > 50% (crisis mode)
- Reduce size by 50% if vol > 35% (elevated risk)
๐ Documentation
Detailed documentation in /docs/:
- Strategy Logic: Why the model works (financial rationale)
- Feature Engineering: Description of all 100+ features
- Methodology: Model training, validation, and robustness testing
๐ฌ Robustness & Anti-Overfitting Measures
- Chronological Splitting: 60/20/20 train/val/test (no look-ahead)
- Rolling Z-scores: Features converted to relative values (stationarity)
- Feature Selection: Top 15 features selected via F-statistics
- Regime Detection: Model aware of market volatility state
- Outlier Clipping: All features winsorized to prevent extreme values
- Parameter Stability: Calmar > 1.5 across all tested variations
๐ Key Features Generated
Volatility Surface (20 features)
- IV by moneyness: Deep OTM Put, OTM Put, ATM, OTM Call, Deep OTM Call
- IV by tenor: Weekly (0-10d), Monthly (10-45d), Quarterly (45-90d), Long (90d+)
Greeks & Positioning (15 features)
- GEX (Gamma Exposure): Total, ATM, Call, Put
- Vega exposure by call/put
- Delta exposure & net flow
Sentiment & Flow (10 features)
- Put/Call ratios: Volume, OI, OTM
- Volume by moneyness and tenor
- Dollar volume flows
Momentum & Volatility (8 features)
- Realized volatility: 5d, 10d, 20d, 60d
- Price momentum: 5d, 10d, 20d, 60d
Advanced (20+ features)
- VRP (Variance Risk Premium)
- Volatility skew (put premium over calls)
- Term structure (short-term vs. long-term IV)
- Interaction terms (GEX ร momentum, VRP ร skew, etc.)
๐ References & Inspiration
- Variance Risk Premium: Carr & Wu (2009), Bollerslev et al. (2009)
- Gamma Exposure: SqueezeMetrics, SpotGamma research
- Volatility Skew: Bates (1991), Rubinstein (1994)
- Options Market Microstructure: Gรขrleanu, Pedersen, Poteshman (2009)
๐ ๏ธ Technical Details
Dependencies:
- Python 3.8+
- pandas, numpy, scikit-learn
- lightgbm, xgboost
- matplotlib, seaborn
- QQQ end-of-day options data (strike, IV, Greeks, volume, OI)
- Minimum 2+ years of history for proper training
๐ License
This project is for educational and research purposes.
๐ Acknowledgments
Developed as part of the Quanta Options Big Data Challenge. Special thanks to the quantitative finance community for open research on options market microstructure.
Disclaimer: This is a research project. Past performance does not guarantee future results. Trade at your own risk.