SMalaekeh
qqq-options-alpha-research
Jupyter Notebook

A robust, regime-adaptive QQQ trading strategy utilizing ensemble machine learning and options market microstructure signals (GEX, VRP, Skew).

Last updated Jul 26, 2026
10
Stars
5
Forks
1
Issues
0
Stars/day
Attention Score
28
Language breakdown
Jupyter Notebook 95.1%
Python 4.9%
โ–ธ Files click to expand
README

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:
- Volatility surface (IV by moneyness ร— tenor) - Greeks & GEX (Gamma Exposure) - Variance Risk Premium (VRP) - Put/Call ratios & flow metrics - Regime detection (High/Low volatility)
  • 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)
- Spread between implied volatility and realized volatility - High VRP โ†’ Market overpricing risk โ†’ Mean reversion opportunity
  • Gamma Exposure (GEX)
- Measures dealer hedging needs - High GEX โ†’ Price suppression (dealers hedging) - Low/Negative GEX โ†’ Increased volatility
  • Put/Call Ratios
- Sentiment indicator (fear vs. greed) - Elevated put buying โ†’ Potential reversal signal
  • Volatility Skew
- Difference between OTM put and call IVs - Steepening skew โ†’ Rising hedging demand โ†’ Bearish signal

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).
* Interpretability: Tree-based models allow for explicit feature importance analysis (Gini/Gain), aligning with the challenge's requirement for a "logical framework." * Robustness: Bagging and Boosting proved more stable across changing volatility regimes than neural networks.

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
Signal Generation:
  • Raw predictions โ†’ EMA smoothing (reduce noise)
  • Volatility targeting (scale positions by realized vol)
  • Regime filter (reduce/eliminate positions during crises)
Risk Management:
  • 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/:

๐Ÿ”ฌ 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
Data Requirements:
  • 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.

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท SMalaekeh/qqq-options-alpha-research ยท Updated daily from GitHub