Add VIX threshold-crossing backtest on QQQ - #3
Draft
ax3301 wants to merge 4 commits into
Draft
Conversation
Signal: VIX prior-day High < threshold and current-day High >= threshold; buy QQQ at the close, measure 5/20/60-day forward returns for thresholds 17-22. Reports N, mean, median, win rate, best/worst per horizon and compares against a QQQ buy-and-hold benchmark. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JXFxuoYQvap2iq4EHbf9GW
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JXFxuoYQvap2iq4EHbf9GW
…uy&hold Strategies: 200d trend filter, Connors RSI2 mean reversion, dip-buy, and a VIX-spike 10-day dip-buy. Reports total return, CAGR, vol, Sharpe, max drawdown, exposure and trade frequency over full history and last 5 years. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JXFxuoYQvap2iq4EHbf9GW
Enumerates 252 candidate QQQ timing strategies, tests market-timing alpha (equity premium stripped out) with HAC/Newey-West t-stats, applies Benjamini-Hochberg and Benjamini-Yekutieli FDR correction in-sample (1999-2016), then confirms survivors out-of-sample (2017-2026). Zero strategies pass both gates once beta is separated from skill. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JXFxuoYQvap2iq4EHbf9GW
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Backtests a VIX-spike entry strategy on QQQ.
Signal (for each threshold T ∈ {17, 18, 19, 20, 21, 22}):
Measured: QQQ forward return over the next 5 / 20 / 60 trading days.
Reported per threshold × horizon: sample count, mean, median, win rate, best, worst — plus a QQQ buy-and-hold benchmark (average forward return over all trading days) and each cell's edge vs that benchmark.
Data
Yahoo Finance daily OHLC for
^VIXandQQQ, aligned on the common trading calendar (1999-03-10 → 2026-08-07, 6,896 trading days).Files
vix_qqq_backtest.py— self-contained script (python3 vix_qqq_backtest.py)vix_qqq_results.json— full output including every signal dateHeadline finding
Buying QQQ when VIX High crosses up through a low threshold (17–20) roughly matches buy-and-hold; crossing up through a high threshold (22) is where forward returns turn negative in the short/medium term — i.e. the entry has essentially no timing edge, and gets worse as the trigger level rises.
🤖 Generated with Claude Code
https://claude.ai/code/session_01JXFxuoYQvap2iq4EHbf9GW
Generated by Claude Code