devsachan23/crude_oil_quant
๐ข๏ธ Crude Oil Systematic Walk-Forward Strategy
Brent Crude Total Return Index (2016โ2024) Sharpe: 0.847 vs Baseline: 0.462
๐ Project Overview
This project implements a systematic multi-signal trading framework on the Brent Crude Total Return Index using:
- Diversified signal construction (Trend, Mean Reversion, Volatility-aware, Orthogonal)
- Walk-forward adaptive strategy selection
- Volatility targeting (15% annualized)
- Transaction cost modeling (0.015% per trade)
- Regime attribution analysis
The primary objective is to maximize out-of-sample Sharpe ratio in a realistic setting, strictly avoiding look-ahead bias.
All strategy selection decisions are made using only information available at each rebalance date.
โ๏ธ Strategy Architecture
๐น Signal Groups (11 Base Signals)
Trend-Following
- 1M Momentum
- 3M Momentum
- 200D Moving Average Crossover
Mean Reversion
- 20D Z-score Reversion
- 5D Reversal
- Percentile Reversion
Volatility-Aware
- Vol-Adjusted Momentum
- Volatility Breakout
- Volatility Trend
Orthogonal
- Carry Proxy (Momentum Spread)
- Momentum ร Volatility Filter
Each base signal is extended with a volatility-scaled variant.
Final candidate pool:
- 11 base
- 11 vol-scaled
- 1 equal-weight ensemble = 23 competing strategies
๐ Walk-Forward Framework
Every 6 months:
- Evaluate all 23 candidate strategies over the previous 18 months
- Score using composite metric:0.6 ร Sharpe + 0.4 ร Sortino
- Select best performer
- Deploy out-of-sample until next rebalance
This process ensures:
- No look-ahead bias
- Adaptive strategy selection
- Reduced overfitting risk
Walk-forward logic mirrors the provided WalkforwardBacktester implementation.
๐ฏ Risk Management
- Transaction Cost: 0.015% per trade
- Volatility Target: 15% annualized
- Volatility Estimate: 63-day EWM (1-day lag)
- Leverage Scalar Clipped to: [0.25ร, 4ร]
Volatility targeting is applied before strategy selection so all candidates compete on equal risk footing.
๐ Performance Summary
Improvement is driven primarily by disciplined volatility control and adaptive selection rather than aggressive directional forecasting.
The strategy demonstrates resilience during high-volatility regimes, particularly during the 2020 oil crash.
๐ก๏ธ Regime Attribution
Performance is decomposed across:
- High Volatility (>65th percentile)
- Low Volatility (<35th percentile)
- Neutral Regime
Results indicate consistent performance across regimes, with enhanced stability during extreme volatility periods.
๐ป Interactive Dashboard
An interactive Streamlit dashboard allows:
- Strategy selection
- Walk-forward parameter tuning
- Volatility targeting adjustments
- Regime filtering
- Rolling Sharpe visualization
- Selection frequency diagnostics
- Full performance comparison
Run locally:
streamlit run app.py
๐ Repository Structure
app.py # Streamlit dashboard
backtest.py # Walkforward backtester class
crude_oil_strategy.ipynb # Research notebook
crude_oil_strategy.html # HTML export of notebook
brent_index.xlsx # Data file
performance_summary_improved.csv
requirements.txt
README.md
๐ฆ Installation
pip install -r requirements.txt
๐ง Design Philosophy
This project emphasizes:
Out-of-sample integrity
Adaptive systematic allocation
Risk-adjusted performance over raw returns
Clean, reproducible implementation
The objective is disciplined quantitative design rather than curve-fitting.
๐ Future Extensions
Multi-commodity extension
True futures carry implementation
Cross-asset regime conditioning
Longer historical backtesting
๐ค Author
Dev Sachan
Quantitative Strategy Project
2026
