Skip to content

willhammondhimself/Trading-Strategy-Challenges

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trading Strategy Challenges

This repository contains implementations of two quantitative trading strategy challenges focused on signal mapping and options-based forecasting.

Overview

Both challenges involve developing systematic trading strategies with specific risk-adjusted return objectives. The implementations prioritize robustness, interpretability, and risk management over model complexity.

Challenge 1: Signal Mapping Strategy

Objective

Create an optimal mapping from 51 input signals (10 long-term + 41 short-term) to portfolio exposure values that beat a provided baseline in risk-adjusted returns.

Approach

  • Signal Processing: Standardized signal transformations with volatility-based filtering
  • Feature Engineering: Signal interactions, momentum indicators, and regime detection
  • Model: Ridge regression with walk-forward validation to prevent overfitting
  • Risk Management: Dynamic exposure limits with volatility-adjusted position sizing

Key Features

  • Volatility regime detection for conditional signal weighting
  • Signal interaction terms to capture non-linear relationships
  • Walk-forward validation with expanding windows
  • Aggressive leverage in high-conviction scenarios (up to 3.0x)

Performance Metrics

The strategy is evaluated on:

  • Sharpe Ratio: Risk-adjusted returns
  • Calmar Ratio: Return relative to maximum drawdown
  • Maximum Drawdown: Largest peak-to-trough decline

Files

  • Challenge1_Signals/QV_Signal_Strategy.py - Main strategy implementation
  • Challenge1_Signals/Signal_Mapping_Analysis.ipynb - Development process and analysis
  • Data/QQQ_base - QQQ_base.csv - Baseline signal reference data

Challenge 2: Options-Based Directional Forecasting

Objective

Use end-of-day QQQ options data to forecast next-day directional movement with exposure range -1.0 to +1.5 and target Calmar ratio > 2.0.

Approach

  • Data Source: Millions of rows of end-of-day options prices and Greeks
  • Feature Engineering:
    • Options sentiment indicators (put/call ratios, skew)
    • Volatility surface metrics (IV percentiles, term structure)
    • Positioning signals (open interest, volume concentrations)
    • Greeks-based risk metrics (gamma exposure, delta imbalance)
  • Model: Ensemble approach combining multiple signal types
  • Risk Management: Strict exposure limits with downside protection

Key Features

  • Comprehensive options Greeks utilization (delta, gamma, vega, theta)
  • Put-call ratio analysis across strikes and expirations
  • Implied volatility surface analysis for regime detection
  • Open interest and volume flow analysis
  • Lookahead bias prevention in all feature calculations

Performance Targets

  • Calmar Ratio: > 2.0
  • Sharpe Ratio: > 1.5
  • Exposure Range: -1.0 to +1.5

Files

  • Challenge2_Options/QV_Options_Strategy.py - Main strategy implementation
  • Challenge2_Options/Options_Strategy_Analysis.ipynb - Development process and analysis
  • Data/options_eod_SPY.csv - SPY options end-of-day data (6.5M rows)
  • Data/options_eod_QQQ.csv - QQQ options end-of-day data (5.0M rows)

Data Files

Large Data Files (Not Included in Repository)

Due to GitHub's file size limitations, the following large data files are not included in this repository:

  • Data/options_eod_SPY.csv (~1.35 GB)
  • Data/options_eod_QQQ.csv (~1.04 GB)

Note: These files are required to run the Challenge 2 options strategy. The baseline signal file for Challenge 1 is included.

Included Data

  • Data/QQQ_base - QQQ_base.csv - Baseline signal reference for Challenge 1

Options Data Schema

The SPY and QQQ options datasets (when obtained) contain:

  • tradeDate: Trading date
  • spotPrice: Underlying price at close
  • strike: Option strike price
  • delta, gamma, vega, theta, rho: Options Greeks
  • callPrice, putPrice: Option prices
  • callOpenInterest, putOpenInterest: Open interest
  • callVolume, putVolume: Trading volume

Date range: 2020-present (depending on data availability)

Requirements

Python Version

  • Python 3.8 or higher

Dependencies

pandas>=1.3.0
numpy>=1.21.0
scipy>=1.7.0
scikit-learn>=1.0.0
matplotlib>=3.4.0
jupyter>=1.0.0

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/Trading-Strategy-Challenges.git
cd Trading-Strategy-Challenges
  1. Install dependencies:
pip install -r requirements.txt

Or install manually:

pip install pandas numpy scipy scikit-learn matplotlib jupyter

Usage

Running Challenge 1

python Challenge1_Signals/QV_Signal_Strategy.py

Running Challenge 2

python Challenge2_Options/QV_Options_Strategy.py

Exploring Analysis Notebooks

jupyter notebook Challenge1_Signals/Signal_Mapping_Analysis.ipynb
# or
jupyter notebook Challenge2_Options/Options_Strategy_Analysis.ipynb

Results

Both strategies demonstrate the ability to generate positive risk-adjusted returns through systematic signal processing and disciplined risk management.

Challenge 1: Signal Mapping

  • Successfully beats baseline metrics through robust signal combination
  • Demonstrates regime-aware exposure management
  • Shows consistent performance across walk-forward validation windows

Challenge 2: Options Strategy

  • Achieves target Calmar ratio through comprehensive options analysis
  • Utilizes multi-dimensional features from options Greeks and positioning
  • Maintains strict exposure discipline while capturing directional opportunities

Methodology Notes

Development Process

The Jupyter notebooks document the iterative development process, including:

  • Initial feature exploration and analysis
  • Model selection and hyperparameter tuning
  • Performance evaluation across multiple metrics
  • Identification and resolution of lookahead bias
  • Walk-forward validation results

Risk Management

Both strategies implement:

  • Strict exposure limits to control portfolio risk
  • Volatility-based position sizing
  • Maximum drawdown monitoring
  • Regime-aware signal adjustments

Acknowledgments

Research conducted with assistance from Perplexity AI.

License

This code is provided for educational and demonstration purposes.

Author

Will Hammond November 2025

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published