Repository navigation
Add overnight research labs and a separate VIX-regime momentum model (additive) - #1
Open
ngcoding10 wants to merge 229 commits into
Open
ngcoding10 wants to merge 229 commits into
ngcoding10 wants to merge 229 commits into
Conversation
…arch studies Data: the as-traded backtest showed +168% on 2005-05-16 from a bad Yahoo price. Isolated bad prints (a >50% jump that reverts the next bar) are now masked, Yahoo's dividend factor is repaired when it jumps by a split ratio and back, and the price cache is versioned so it re-downloads. HMM: optional tempering of each day's evidence (rolling-window symptoms overlap, which made the filter overconfident: ~97% claimed vs 76% right on the synthetic market), optional label alignment across refits, warm starts re-expressed in the new standardisation, and a one-step predictive log-likelihood for out-of-sample comparison. qtrade/research + research workflow: real bid-ask spreads sampled from Alpaca SIP quotes vs the cost model; per-signal break-even cost and a first-half-chosen composite; walk-forward HMM variants scored by predictive likelihood, calibration and usefulness; a data-quality scan. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
…e is biggest alt_signals: earnings surprise (SUE), earnings-announcement return, earnings yield, book-to-market, gross profitability, asset growth, accruals (all from SEC filings, usable the day after filing), and news volume, headline tone, no-news reversal and news momentum (from article times). conditional: IC of the reversal signals and the composite inside vs outside stressed regimes, high dispersion, light volume and no-news, and portfolios that only trade inside each condition, scored on break-even cost. The research workflow now also fetches the encrypted fundamentals and news datasets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
portfolio.regime_ic estimates the forecast's IC separately for each HMM regime (probability-weighted, shrunk toward the prior) and expects today's IC from today's regime probabilities. portfolio.edge_scaling scales exposure by IC_hat / reference, capped at full size. Without it the IC estimate has no effect on size whenever the gross or volatility cap binds, so the book was the same size whether the edge was large or small. Both are off by default and appear as backtest diagnostic variants. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
Every pair of signals, summed (with first-period signs) and multiplied (an interaction), scored on IC in 2004-2014 vs 2015-2026, share of positive years, persistence (21-day vs 1-day IC) and gain over the better single signal. Reports how well the first-period ranking predicts the second (how much is luck across ~3,000 combinations) and the break-even cost of the top and sticky pairs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
…al selection model.select_stable: at every refit, a signal is used only if its daily IC had the same sign in each third of that refit's own training window and |t| >= 2 overall; the others are zeroed for that period. Selection never looks past the refit date, so 2015-2026 stays a fair test. The backtest writes which signals were kept at each refit (selected_signals.csv), and the combinations study reports whether signals consistent through 2014 stayed consistent afterwards. config/small_account_stable.yaml turns it on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
Jumps = factor-residual moves beyond 3 trailing standard deviations. - Overdispersion of daily market jump counts (var/mean vs 1 for Poisson) - INGARCH(1,1) self-exciting Poisson model (discrete-time Hawkes), fitted on 2004-2014 and scored out of sample against a constant rate - Poisson HMM with regime-specific jump rates, walk-forward, scored on crash calibration and reversal IC like the Gaussian HMM - Gamma-Poisson shrunk stock jump intensities as signals (crash_risk, jump_skew, jump_intensity) and a Poisson news-surprise signal - Event study of returns after up/down jumps, with and without news The new signals also feed the conditional and combinations studies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
Hawkes: bivariate up/down-jump model with cross-excitation (branching matrix, spectral radius) and a fast + slow two-kernel model for long memory, fitted on 2004-2014 and compared out of sample with INGARCH and a constant rate. Poisson regressions (log link): per-stock up/down jump counts over the next 21 days on Hawkes-style decayed jump memory (own fast/slow, market), vol, abnormal volume, size, momentum and news, reported as rate ratios with out-of-sample deviance explained; the predicted crash intensity becomes a signal. Daily news counts on moves, volume, size and weekday; the unexplained part is a news-surprise signal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
garch: GARCH(1,1) and GJR-GARCH, Gaussian and Student-t, estimated on 2004-2014 (variance targeting, IIR filter) and compared with rolling and EWMA variance on out-of-sample QLIKE, for the market and for stock residual volatility (what the portfolio sizes with); plus a volatility-managed version of the composite scaled by each forecast. glm: ridge (Gaussian GLM), logistic (binomial GLM on beating the median), Huber and a small MLP on the same 44 signals, refit yearly on 5 years, scored on out-of-sample IC and break-even cost; and a Gamma GLM (log link) for next-month residual volatility vs the 63-day rolling estimate. Research runs now each get their own concurrency group, so a push no longer cancels a long run, and a commit message tag selects the tasks to run. [research: garch,glm] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
21 model families (simple IC weightings, PCA regression, ridge at four strengths, elastic net, lasso, logistic, Huber, two gradient-boosting depths, extra-trees, three MLPs, random-Fourier kernel ridge) x 4 signal sets (reversal, price, +fundamentals, +news) x 3 horizons (1, 5, 21 days), refit yearly on 5 years; each forecast traded 6 ways (smoothing x universe) with measured costs: ~1,500 strategies. The aggregate step ranks on 2006-2014 only and reports how the top picks did in 2015-2026, the rank correlation between periods, a deflated-Sharpe luck hurdle, a first-period-chosen ensemble, pros/cons per family, and best_correlations.csv: signals, pairs and models ranked by the IC in their weaker period. Runs as 12 parallel jobs (model-zoo workflow). [research: quality] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
Market timing on SPY (12-month trend, 200-day average, GARCH vol-managed, HMM regime timing, overnight vs intraday, turn of month, after VIX spikes); cross-asset trend following, risk parity and momentum over stock, bond, gold, commodity, international and REIT ETFs; sector momentum; monthly long-short stock factors (momentum, low vol, 52-week high, quality, value, earnings drift, accruals, multi-factor, factor momentum); pairs trading within peer clusters; and the earnings-announcement premium. Each is net of costs, judged on 2006-2014 vs 2015-2026, and correlated with the reversal book; a diversified book chosen on 2006-2014 is tested on 2015-2026. [research: alt,strategies] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
…egy blocks The expected-filing panel mixed datetimes into a float frame, which failed on real data and took down the whole study. Expected dates are now day numbers, and each block of strategies runs on its own so one failure can't lose the others. Adds a test that runs the earnings premium on filings. [research: alt,strategies] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
New families: random forest, robust (L1) boosting, early-stopped boosting, PLS with 3 and 8 components, Bayesian ridge, linear SVR, narrow and wide kernel bandwidths, time-decayed ridge, expanding-window ridge, regime ridge (signal x tempered-HMM stress interactions) and a stacked average of ridge, boosting and an MLP. A 63-day horizon lets momentum, value and quality show what they do over months. The workflow now runs only the jobs a commit names, merges in an earlier run's results, and keeps every merged result so later runs add to them. [zoo: extra@1,5,21,63; simple,linear,tree,nn@63] [zoo-prev: 39532819456] [research: quality] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
qtrade/research/ideas.py holds new signal ideas registered by theme and wave; the zoo's 'ideas' group scores each at a horizon (IC in 2006-2014 and 2015-2026, years positive, and break-even cost trading it in the direction found in 2006-2014) and the results join best_correlations.csv. Wave 1: volatility-scaled momentum, frog-in-the-pan, momentum consistency, peer-relative momentum, stock time-series momentum, 50/200-day average gap, MACD, distance from the 52-week high, volatility change, residual skewness, co-skewness, illiquidity change, on-balance-volume divergence, earnings and revenue growth, ROE, leverage, net share issuance, R&D intensity, cash ratio. [zoo: ideas@1,5,21,63] [zoo-prev: 39532819456] [research: quality] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
[research: quality] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
qtrade/data/public.py: FRED macro series (with publication lags), S&P 500 index changes, FINRA Reg SHO daily short volume, SEC insider transactions (Forms 3/4/5 data sets), and daily bars for every US stock Alpaca knows, including delisted ones (for a survivorship-free universe). Downloads give up after repeated failures instead of hanging. The zoo's prep step fetches them once and caches them for the jobs. Ideas wave 2: short-volume level and abnormal change, insider net buying and cluster buying, filing delays, correlation-network momentum, calendar-month seasonality, overnight momentum, nearness to the 52-week low, nominal price, volume-spike continuation, and changes in earnings surprise. [zoo: ideas@1,5,21,63] [zoo-prev: 39532819456] [research: quality] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
…ntraday-derived signals survivorship: rebuild a point-in-time top-1000 universe (2016+) from Alpaca bars for every US stock including delisted ones, and score the same close-to-close signals on it and on today's survivors over the same dates; the difference is each signal's survivorship bias. events: returns after 15 headline-classified news types (merger, FDA, guidance, beats/misses, upgrades, price targets, offerings, lawsuits, buybacks, dividends, CEO changes) from the first open after the article; continuation after novel vs stale news; and the return path around S&P 500 additions and removals. intraday_stats: realized variance, skewness, kurtosis, jump share and the first/last half-hour return per stock and day from the 5-minute bars, computed once in the zoo's prep step. Ideas wave 3 turns them into signals. [zoo: ideas@1,5,21,63] [research: events,survivorship] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
…o timing, optimisation, capacity, execution - Trend following (3-month, 12-month, blended) and cross-sectional momentum over ~30 ETFs: commodities, currencies, Treasuries, TIPS, credit, country and style equity, REITs - Volatility premium: short SVXY in VIX contango, long VIXY in backwardation - Sector seasonality: same-calendar-month leaders over the past 10 years - Macro (FRED: term spreads, credit spread, real rates, dollar, oil, VIX, financial conditions, jobless claims): correlation with next month's market and momentum returns; macro-timed SPY and momentum; momentum scaled by its own volatility (crash protection) - Ledoit-Wolf mean-variance vs inverse-vol vs equal weights across strategies, weights from 2006-2014 only - Capacity: net Sharpe of momentum / 52-week high / quality at 0k to B with square-root impact - Execution: the same signals traded at the next open vs the next close [research: alt,strategies] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
…izing seq group: ridge, boosting and an MLP fed raw histories (last 20 daily residual returns in vol units, last 10 volume changes, last 12 monthly returns), alone and alongside the hand-made signals. online group: ridge, boosting and an MLP combined three ways - equal weights, weights following each model's trailing out-of-sample IC (lagged until the labels are known), and an equal blend scaled down when the models disagree. [zoo: seq,online@1,5,21,63] [research: quality] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
[research: quality] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
Events: articles published before the open made the first day's close-to-close return include the gap at the open, which happened before anyone could act (upgrades showed +77 bp, t = 32). Day 1 now counts from the open to the close; novelty uses the gap into that open as the move. Survivorship: Alpaca's asset list includes non-ticker identifiers that make the bars API reject a whole batch; keep real tickers only and drop any rejected symbol and retry. [research: events,survivorship] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
…aled and decile targets [zoo: ideas@1,5,21,63; targets@1,5,21,63] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
…t proxies FRED's CSV endpoint timed out on every series from GitHub's runners, costing ten minutes and leaving the macro-timing study empty. Fall back to yields (^TNX/^IRX/^FVX), VIX, the dollar index, oil and HYG/LQD, TIP/IEF ratios. [research: strategies] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
…TF pairs, momentum/reversal risk parity - Each factor book (momentum, low vol, 52-week high, quality) ranked inside peer clusters, hedged to zero beta with an equal-weight market leg, and sized by 1 / trailing 6-month volatility - Pairs trading among ~45 liquid ETFs (pairs re-formed yearly, corr > 0.8) - Momentum and the reversal book blended by 1 / trailing volatility [research: strategies] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
…overnight/intraday persistence Each strategy holds one slice of the day (overnight, first half hour, middle, last half hour) decided with what is known at entry, from the 5-minute daily statistics. Trades at the open cost 3x, matching the measured spreads. [research: intraday] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
…asso-then-boosting - 10 signal pairs that kept working together, fed to models as products - The 20 ideas with the strongest 2006-2014 IC at each horizon as extra inputs - Two-stage model: lasso selects inputs, gradient boosting models only those [zoo: features@1,5,21,63] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
… untagged pushes - survivorship: (signal, horizon) tuple keys broke the JSON summary - S&P 500 changes: find the change table by its added/removed/date columns, with or without two header rows (the old lookup found nothing) - research workflow: a push without a [research: ...] tag now skips the studies instead of failing on grep's exit code [research: events,survivorship] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
…es, dividends, CEO changes) Counts of each headline type over the last 5-21 days, dated the day the news is known at the close. The directions come from the 2015-2026 event study, so their 2015-2026 ICs are in-sample; the theme says so. [zoo: ideas@1,5,21] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
…d on that split News signals have no 2006-2014 data, so best_correlations.csv now judges them on whether they kept their sign from 2015-2020 to 2021-2026. [zoo: ideas@1,5,21] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
…ogress) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kGVQXjsXpnFwCBYtc1BUp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kGVQXjsXpnFwCBYtc1BUp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kGVQXjsXpnFwCBYtc1BUp
…dged long-only, costs, bootstrap, US combination) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kGVQXjsXpnFwCBYtc1BUp
… flat-in-stress and survivor-premium tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kGVQXjsXpnFwCBYtc1BUp
…s; survivor premium measured Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kGVQXjsXpnFwCBYtc1BUp
…d DAX Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kGVQXjsXpnFwCBYtc1BUp
…s study Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kGVQXjsXpnFwCBYtc1BUp
…, every listed Asia-Pacific financial, rates and FX data Adds deep_universe.py (Yahoo screener by region and industry), macro_data.py (OECD rates, US yields, FX), new_exchanges.py (out-of-sample test of the flat-in-stress rule), new_exchanges_robust.py (costs, borrow, delay, legs, capacity) and asia_fin_deep.py (selection, industry momentum, lead-lag, rates). Frictions for the new markets added to intl_lab. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kGVQXjsXpnFwCBYtc1BUp
…bined book Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kGVQXjsXpnFwCBYtc1BUp
…k, result tables REPORT.md summarises the three layers (21 index universes, 20 pre-registered new exchanges, every listed Asia-Pacific financial). survivorship_sim.py calibrates the 'today's largest survivors' bias on synthetic zero-momentum markets (it lowers momentum Sharpe by ~0.15-0.2 per market). breadth_check.py separates mid-cap breadth from market choice. Result CSVs and universe lists are in research_international/reports/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kGVQXjsXpnFwCBYtc1BUp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kGVQXjsXpnFwCBYtc1BUp
…); US pairs sleeve survives next-open execution Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kGVQXjsXpnFwCBYtc1BUp
…ined book Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kGVQXjsXpnFwCBYtc1BUp
… exchange), pre-registered test passes narrowly Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kGVQXjsXpnFwCBYtc1BUp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kGVQXjsXpnFwCBYtc1BUp
The overnight book books one row a day, so running it before the European closes would skip today's European books; the HFT tracker adds each market once a day and can run any time after a market's close. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
…s956 foreign-sheet: tracker-only run option
Appending trades with INSERT_ROWS inserted whole sheet rows and pushed the per-market summary (beside the trade rows) down. Trades now append with OVERWRITE, and the summary range is cleared and rewritten after the append. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
…s956 Foreign HFT tracker: keep the summary in place
…rkets P&L was shown on $1,000 per market; it is now on a $10,000 book split equally between the tracked markets ($1,111.11 each for 9). Still $0 of the real sheet book. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
…s956 Foreign HFT tracker: hypothetical $10,000 book
With every strategy disabled, the shadow HFT used to idle behind a 'Paused' line. It now trades the replay's picks live as a tracker: 1,000 stocks, the tab updated every 5 s, P&L on a hypothetical $10,000. The tab is marked 'TRACKER ($0 allocated, NOT part of the $10,000 book)'. Strategies that pass a future replay still trade the real sleeve. A watchdog schedule (hourly during the session) starts the run when GitHub skips the 9:25 start, as it did on 2026-10-23. An extra run only queues behind a running one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
…s956 US HFT tab live again as a $0 tracker; watchdog schedule
On 2026-10-23 GitHub skipped the 15:44 flip-sleeve and 16:25 auction-sheet runs and fired the 17:11 foreign-sheet run at 20:25. Each sleeve now gets several cron times a day and a wide window: flip 15:40-24:00 NY (after the close the latest price is the official close), auction 16:20-24:00 NY, foreign 17:11-21:11 UTC. A day already booked is skipped, so the extra firings do nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsPrq53XXinQsUZsWqeKht
…s956 Daily sleeves survive late or skipped GitHub schedules
…mbia, Peru, NY ADRs) Pre-registered test of the flat-in-stress rule: all four predictions pass (5-market book 1.09 / 0.75 / 1.43), but Brazil's edge sits in small names, Argentina/Colombia/Peru are not borrowable and lose it at triple costs, and the tradable ADR sleeve (0.4-0.6) lowers the combined book. Also South American financials (no special edge) and commodity lead-lag (none). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kGVQXjsXpnFwCBYtc1BUp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kGVQXjsXpnFwCBYtc1BUp
…h branch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kGVQXjsXpnFwCBYtc1BUp
|
Fix this |
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 this adds
A self-contained
research_night/folder: a second research pass over the trading system, run on the same 1,000-stock daily universe (2000-2026) with the same walk-forward / two-period rules. Nothing existing is modified or replaced; the only change proposed to existing files is an optional regime setting (regime.features: macro, default unchanged) shipped as a patch file, not applied here.REPORT.md- findings and recommendationsFOR_ARJUN.md- how to drop the modules into theclaude/keen-tesla-shs956branch and reproducenight_lab_log.md- chronological log of every experiment, including failed ones and figures later revised downwardstability_report.md- review of the existing research outputs and two bugs found in themheadline_numbers.csv- every key number in one tablecode/- 9 research modules (lab_prep,regime_lab,jump_lab,invariants_lab,switch_lab,switch_robust,book_lab,pairs_lab,momentum_flip); they import the research package fromclaude/keen-tesla-shs956, which this branch does not yet containpatch/- the optional macro-regime option for the live pipelinereports/- every run's output (markdown + CSV)The separate model
momentum_flip: a monthly long/short stock-momentum book held short whenever the VIX is above 20. Nothing fitted. Staggered across start days: net Sharpe 0.67 / 0.74 / 0.22 in 2006-14 / 2015-20 / 2021-26 (about 4% a year at 7% volatility unlevered).python -m qtrade.research.momentum_flip --today --liquid --top-frac 0.1prints the current target book. Added to the existing ETF book next topairs(sized 2x when VIX > 20) it takes the book from Sharpe 0.87 / 0.85 / 0.96 to 1.15 / 1.18 / 1.00 with a smaller worst drawdown (-12% vs -15%).Other findings (details in REPORT.md)
downside_betais broken and sits atopbest_correlations.csv. The "1st period" inedge.summarizeis 2001-2014, not the documented 2006-2014.Caveats
Survivor universe throughout (should be re-run point-in-time before real money); one out-of-sample period whose last five years are not distinguishable from zero for the flip; encrypted intraday/news data not used.
Tests
The upstream test suite (100 tests) passes with the modules and the patch applied on
claude/keen-tesla-shs956.Generated by Claude Code