About this project

This repository is a Python-based quantitative trading research project centered on a short-term reversal call-buying setup: after a large intraday drawdown, some names tend to rebound over the following sessions. The work is organized as a sequential research path rather than a single script, and the current official version is labeled Reversal 3.5. Strategy framing - Official universe: qqq_plus_leverage_etfs, described as qqq_only_filtered plus SOXL, UPRO and DRAM. - Filters: 60-day lookback, matched_signals >= 10, minimum current drop > 0.5%, a non-ETF trailing P/E < 140 guard, and a live trend-health gate that blocks short-term down channels. - Timing overlay: a 5-day technical-indicator timing score with a 0.50 no-trade gate. - Trade framing: near-ATM calls, roughly 30 DTE in backtests, with exit ladders described as +10%/+15%/-10% in research and +15%/+15%/-10% in live execution. - Live paper test: scheduled no-lookahead scans with an option-liquidity gate and a no-trade rule when liquidity is poor, publishing dashboard output to GitHub. Research journey Early notebooks (for example versions/notebooks/Reversal2.0.ipynb and Reversal2.1.ipynb) started from a small legacy watchlist of about ten names, pulling one year of Yahoo Finance Close/High/Low data, computing daily Max Drop, and letting the user set a same-day drop threshold, a recovery target and a lookahead window. An option layer was then added: given expiry, implied volatility, entry price and risk-free rate, Black-Scholes and GBM-based simulations estimate day-by-day call PnL confidence intervals. The project then advanced through staged upgrades: 1. Formalize the base signal: a signal day plus a success criterion of reclaiming 70% of the signal-day drop within a lookahead window. 2. Compare universes; the conclusion was that a more curated qqq_only_filtered pool outperformed broader pools. 3. Refine the signal with a 60-day window, minimum current drop > 0.5%, and a small leveraged-ETF overlay. 4. Add regime awareness, holiday handling, option-liquidity gating, and a no-lookahead live paper runner. 5. Add a timing overlay so not every valid signal becomes a trade, settling on a 5-day window and a timing_score >= 0.50 no-trade gate. Representative research outputs kept in the repo include universe comparison, article-inspired factor variants, minimum-drop experiments, leveraged-ETF overlay experiments, and regime-score analyses, each with CSV and PNG artifacts. Current version notes (3.5) - Early-entry scans from 10:00 AM to 12:00 PM ET are now shadow-only: they record candidates and option-liquidity context but do not open live paper or Alpaca paper positions. - DRAM, a memory/semiconductor ETF, is added to the curated candidate cache for live monitoring and future research. - Earlier hotfixes tightened the option entry liquidity gate (open interest >= 110, volume >= 20, spread <= 14%), distinguished executable option quotes from stale lastPrice marks, and made live execution load the checked-in ticker cache by default to avoid repeated Nasdaq screener requests. - A strict early_entry_score gate and a recovery-stability filter were introduced, and an isolated Alpaca paper execution runner was added using local-only credentials. Featured result The recorded Reversal 3.3 backtest is described as +690.85% total return, -26.42% max drawdown, 69.23% win rate and 4.32 Sharpe over a 2025-04-23 to 2026-04-23 window. Reversal 3.5 keeps that core definition while changing early-entry execution to shadow-only and adding DRAM. The README also documents a live paper checkpoint with equity, realized and unrealized PnL, open positions and links to live trades and equity CSVs. Research discipline is documented in RESEARCH_GUARDRAILS.md, with the stated intent that future upgrades be judged against those standards rather than curve quality alone.