
Case Study
Delta Hedging Platform Updated
An automated options trading system written in Python, integrated with the IG.com broker API to execute real-time delta hedging strategies across live derivatives positions. The platform continuously monitors open options legs, calculates aggregate delta exposure, and automatically places offsetting trades to maintain a delta-neutral portfolio within configurable risk thresholds. Core features include real-time WebSocket feed management with automatic reconnection, per-position P&L tracking, order latency handling, partial fill reconciliation, and a structured logging pipeline for post-trade analysis and strategy review. The system is designed for resilience under live market conditions — gracefully handling API rate limits, stale quotes, and connectivity interruptions — making it production-ready for active algorithmic trading in volatile markets.
Role
Quantitative Developer
Duration
4 weeks
Tech Stack
The Problem
Maintaining delta-neutral options positions in live derivatives markets is a continuous, precision-critical process. Aggregate delta exposure shifts with every tick in the underlying asset price, and manual monitoring introduces dangerous latency during volatile periods. Human traders cannot calculate, monitor, and execute hedging adjustments fast enough to maintain neutrality across multiple open options legs simultaneously — particularly when managing partial fills, API rate limits, and WebSocket reconnections under live market conditions.
My Approach
Built a Python-based automated hedging system with four cleanly separated modules: **IG Markets Client:** WebSocket-based real-time price feed with automatic reconnection logic, graceful handling of stale quotes and API rate limits. Supports both DEMO and LIVE account modes. A MockMarketData fallback enables full system testing without a live broker connection. **Option Calculator:** Black-Scholes pricing implementation using NumPy and SciPy's statistical functions. Computes theoretical price, delta, gamma, theta, and vega for each open options leg, handling both call and put payoff structures. **Delta Hedger:** Core hedging logic that aggregates delta exposure across all open positions, compares it to configurable risk thresholds, and automatically places offsetting trades when the portfolio breaches neutrality bounds. Handles partial fill reconciliation and per-position P&L tracking. **Flask API + Web Dashboard:** REST endpoints expose portfolio state, position details, and hedging activity to a Vanilla JS frontend built with Tailwind CSS. All actions are logged to a structured pipeline for post-trade analysis and strategy review. Deployed on AWS EC2 for the latency profile required by live trading operations.
Results & Impact
A fully automated delta-neutral position management system capable of running against live IG Markets broker accounts. The system eliminates manual monitoring latency, handles live market edge cases (stale quotes, partial fills, connectivity drops) gracefully, and provides a complete audit log for post-trade strategy review. The MockMarketData module enables rigorous backtesting without capital exposure.