Inspiration

Traditional options backtesting tools treat trades as static, single-point entries. However, real-world short-term options trading is highly dynamic. I wanted to capture volatile market reversals by scaling into positions over time. Driven by the mathematical logic of mean reversion, I set out to build an institutional-grade, open-source environment. The goal was to transition a strategy from a conceptual formula to live paper trading without rewriting code.

What it does

QuantResearch is an end-to-end Python framework designed to backtest and paper trade short-term options reversal strategies. It filters massive option universes down to liquid targets, executes multi-tier staged entries, and connects to live brokerage environments. By simulating realistic market impact and slippage, it bridges the gap between theoretical quantitative research and live capital execution.

How I built it

The project is built entirely in Python, leveraging a modular, event-driven architecture.

  • Universe Selection Engine: Filters thousands of option chains down to liquid, high-implied-volatility targets.
  • Staged-Entry Backtester: Tracks multi-tier execution, modeling advanced order types and realistic slippage.
  • Paper Trading Bridge: Connects directly to brokerage APIs via WebSockets for real-time execution.

The quantitative engine relies on statistical indicators. Entry signals track price deviations using standard deviations \(\sigma\) away from a moving average \(\mu\), executing orders when the spot price \(S_t\) meets the threshold:

$$ \vert{}S_t - \mu\vert{} > k \cdot \sigma $$

Challenges I ran into

  • Data Concurrency: Managing massive, multi-strike option chains in real time caused massive memory bottlenecks. I resolved this by implementing asynchronous data processing with asyncio and optimized data structures using pandas and numpy.
  • Execution Realism: Simulating realistic options slippage and bid-ask spreads during high-volatility events was incredibly difficult. I engineered a custom transaction cost model that scales execution drag based on historical market depth.

Accomplishments that I'm proud of

I successfully built a production-ready framework that maintains mathematical consistency across two entirely different execution models. The exact same strategy logic running on historical CSV data packets functions flawlessly when handling live, high-frequency WebSocket streams from a live brokerage API.

What I learned

Building this framework deepened my understanding of event-driven system design and the complexities of microstructure noise in derivatives markets. I learned how vital it is to completely decouple strategy logic from execution logic. This ensures that the core mathematical engine remains pristine and unaffected by the underlying data transport layer.

What's next for QuantResearch

I plan to integrate machine learning models to dynamically optimize the threshold factor \(k\) based on regime-shifting market volatility. Additionally, I aim to expand brokerage integrations to support international multi-asset derivatives and introduce institutional portfolio risk-overlay modules.

Built With

  • algorithmic-trading
  • asyncio
  • backtesting
  • data-analysis
  • event-driven-architecture
  • git
  • github
  • mathematical-modeling
  • numpy
  • options-trading
  • pandas
  • paper-trading
  • python
  • quantitative-finance
  • websockets
Share this project:

Updates