Commit Graph

388 Commits

Author SHA1 Message Date
Youssef Aitousarrah c3362d67e7 feat(commands): auto-propose hypothesis from knowledge base when no arg given
Step 0 reads LEARNINGS.md, scanner domain files, and research files to derive
the highest-priority untested hypothesis, proposes it to the user for confirmation,
then proceeds through the normal backtest flow.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 11:12:22 -07:00
Youssef Aitousarrah 6e43c7164a fix(analytics): merge recommendations into existing dated file instead of overwriting
Multiple runs on the same day (scheduled discovery, hypothesis runner, manual
re-runs) were each clobbering the shared YYYY-MM-DD.json file. Now merges by
loading existing picks and upserting new ones by ticker — later run wins.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 11:04:52 -07:00
github-actions[bot] 936f26a129 chore: update performance tracking 2026-04-16 2026-04-16 14:42:36 +00:00
github-actions[bot] 8500722949 chore: daily discovery 2026-04-16 2026-04-16 14:42:10 +00:00
github-actions[bot] 7420d12d6c chore(hypotheses): update registry 2026-04-16 2026-04-16 09:26:57 +00:00
github-actions[bot] 0dbf7f0963 chore(cache): nightly OHLCV prefetch 2026-04-16 2026-04-16 04:21:03 +00:00
github-actions[bot] ed0db184d0 chore: update performance tracking 2026-04-16 2026-04-16 03:13:53 +00:00
github-actions[bot] b98bfdce89 chore: daily discovery 2026-04-16 2026-04-16 03:13:10 +00:00
Youssef Aitousarrah 54583ee667 fix(filter): load OHLCV from full universe cache key to get cache hit
Requesting only candidate tickers produced a different cache key from the
nightly prefetch, triggering a fresh yfinance download that hit rate limits
(4/75 tickers returned). Now loads the full universe (same key as nightly
prefetch) and slices to candidate tickers — always a cache hit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 20:02:39 -07:00
github-actions[bot] 1da77817ea chore: update performance tracking 2026-04-15 2026-04-15 23:08:38 +00:00
github-actions[bot] af2d4d7471 chore: daily discovery 2026-04-15 2026-04-15 23:08:12 +00:00
Youssef Aitousarrah 9112b14177 fix(filter): deprioritize recent movers instead of dropping, exempt mean_reversion pipeline
- Change recent_mover_action default from "filter" to "deprioritize" so candidates
  that moved >10% in the past 7 days reach the ranker (with lowered priority + context
  annotation) rather than being silently dropped
- Exempt mean_reversion pipeline candidates (rsi_oversold) from the recent-mover action
  entirely — stocks that pulled back hard are the signal, not a disqualifier
- Hoist SCANNER_REGISTRY import to module level (removes duplicate inline imports)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 13:28:26 -07:00
Youssef Aitousarrah 471030facc fix(filter): deprioritize recent movers instead of dropping, exempt mean_reversion pipeline
- Change recent_mover_action default from "filter" to "deprioritize" so candidates
  that moved >10% in the past 7 days reach the ranker (with lowered priority + context
  annotation) rather than being silently dropped
- Exempt mean_reversion pipeline candidates (rsi_oversold) from the recent-mover action
  entirely — stocks that pulled back hard are the signal, not a disqualifier

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 13:28:26 -07:00
github-actions[bot] bab7106d7d chore: update performance tracking 2026-04-15 2026-04-15 20:06:41 +00:00
github-actions[bot] fb26abb06c chore: daily discovery 2026-04-15 2026-04-15 20:06:26 +00:00
Youssef Aitousarrah 01ea2f1dc4 refactor(filter): remove _fetch_batch_prices (replaced by OHLCV cache) 2026-04-15 12:53:12 -07:00
Youssef Aitousarrah 84438adf64 fix(filter): restore missing download_ohlcv_cached import 2026-04-15 12:52:20 -07:00
Youssef Aitousarrah c3ccfd5500 feat(filter): wire OHLCV cache into filter stage, replace yfinance call sites 2026-04-15 12:50:52 -07:00
Youssef Aitousarrah 7d48ad67bc fix(filter): add missing ohlcv import and intraday length guard 2026-04-15 12:46:33 -07:00
Youssef Aitousarrah d7e1b93509 feat(filter): add OHLCV cache helper methods for price/intraday/recent-move
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 12:45:04 -07:00
Youssef Aitousarrah b03ab60f32 test(filter): fix test quality issues in OHLCV cache tests 2026-04-15 12:44:00 -07:00
Youssef Aitousarrah 79599a8ace test(filter): add failing tests for OHLCV cache helper methods 2026-04-15 12:41:53 -07:00
Youssef Aitousarrah c0b5353327 docs: add filter OHLCV cache implementation plan
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 12:35:41 -07:00
Youssef Aitousarrah 883e7ea352 docs: add filter OHLCV cache design spec
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 12:35:41 -07:00
github-actions[bot] e50cbbd0ff chore: update performance tracking 2026-04-15 2026-04-15 14:34:40 +00:00
github-actions[bot] d773d831a1 chore: daily discovery 2026-04-15 2026-04-15 14:34:26 +00:00
github-actions[bot] 3762c3cb3b chore(hypotheses): update registry 2026-04-15 2026-04-15 09:24:18 +00:00
github-actions[bot] 122b346660 chore: update performance tracking 2026-04-15 2026-04-15 06:18:47 +00:00
github-actions[bot] 10a7b894e5 chore: daily discovery 2026-04-15 2026-04-15 06:18:43 +00:00
Youssef Aitousarrah 31a35c7d89 fix(workflow): use git stash --include-untracked to handle new untracked files
Plain `git stash` only stashes tracked modified files. Scripts like
track_recommendation_performance.py write new untracked files to
data/recommendations/ which block `git pull --rebase`. Adding
--include-untracked captures those files in the stash so the rebase
can proceed cleanly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 23:12:17 -07:00
Youssef Aitousarrah 20d3e9fbbe feat(discovery): add mean_reversion pipeline for RSI oversold scanner
The rsi_oversold scanner is a contrarian signal, not a momentum signal —
it fires on short-term panic pullbacks within uptrends and expects a 3-7 day
bounce. Keeping it in the momentum pipeline conflates two fundamentally
different signal types and could cause the ranker to misprice it.

Changes:
- Add mean_reversion pipeline (priority 6, deep_dive_budget 5) to default_config.py
- Move rsi_oversold scanner from pipeline="momentum" to pipeline="mean_reversion"
  in both default_config.py and rsi_oversold.py

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 22:56:05 -07:00
Aitous 5c56f8dc26
research(autonomous): 2026-04-15 — automated research run (#19)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-04-14 22:49:43 -07:00
Youssef Aitousarrah bcbecdeb1e fix(workflow): stash unstaged changes before git pull --rebase in discovery
The discovery run writes delisted_cache.json which isn't staged, causing
'cannot pull with rebase: You have unstaged changes' on all three commit steps.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 22:31:17 -07:00
Youssef Aitousarrah 12a398a29a feat(scanners): remove caps for technical_breakout; add missing config entry
- technical_breakout: max_tickers 150 → 0 (reads from OHLCV cache, no need for cap)
- minervini: fix stale default max_tickers 50 → 0 in code (config already 0)
- default_config: add missing technical_breakout scanner config entry

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 17:19:54 -07:00
Youssef Aitousarrah 7567a17c82 feat(scanners): remove max_tickers caps and raise timeout now that cache is in place
- timeout_seconds: 30 → 120 (cache load alone takes ~28s for 1003 tickers)
- minervini max_tickers: 50 → 0 (no cap)
- high_52w_breakout max_tickers: 150 → 0 (no cap)
- Fix high_52w_breakout to treat max_tickers=0 as no cap (was slicing unconditionally)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 17:15:08 -07:00
github-actions[bot] 5b8c24a64b chore(cache): nightly OHLCV prefetch 2026-04-15 2026-04-15 00:07:31 +00:00
Youssef Aitousarrah 6c1ba91e52 fix(universe): remove Liberty/Fox tickers from remap (yfinance uses compact form)
FOXA, NWSA, FWONA, LBTYA/K, LBRDA/K, LLYVA, GLIBA work fine without hyphens.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 17:02:15 -07:00
github-actions[bot] 55971af5ab chore(cache): nightly OHLCV prefetch 2026-04-14 2026-04-14 23:59:10 +00:00
Youssef Aitousarrah 43cc7eb623 fix(universe): robust iShares→yfinance ticker mapping for class shares
- Filter to Asset Class == Equity only (removes UBFUT, XTSLA non-equity rows)
- Static remap for 16 known iShares compact tickers → canonical yfinance hyphenated form
  (BRKB→BRK-B, BFA→BF-A, HEIA→HEI-A, LENB→LEN-B, UHALB→UHAL-B, CWENA→CWEN-A, etc.)
- Avoids false positives: META, NVDA, TSLA, ABNB, ZBRA, CMCSA preserved correctly
- Fix C401 in ohlcv_cache.py (set comprehension)
- Result: 1003 clean equity tickers from Russell 1000

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 16:55:22 -07:00
Youssef Aitousarrah 0cee7b0161 fix(universe): robust iShares→yfinance ticker mapping for class shares
- Filter to Asset Class == Equity only (removes UBFUT cash collateral, XTSLA money market)
- Static remap for 16 known iShares compact tickers → canonical yfinance hyphenated form
  (BRKB→BRK-B, BFA→BF-A, HEIA→HEI-A, LENB→LEN-B, UHALB→UHAL-B, CWENA→CWEN-A, etc.)
- Avoids false positives: META, NVDA, TSLA, ABNB, ZBRA, CMCSA now preserved correctly
- Result: 1003 clean equity tickers from Russell 1000

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 16:55:22 -07:00
github-actions[bot] 25278cdb92 chore(cache): nightly OHLCV prefetch 2026-04-14 2026-04-14 23:45:27 +00:00
Youssef Aitousarrah 59eb1eecee fix(minervini): remove undefined ticker reference in except clause
F821: _check_minervini_df no longer receives ticker as param after refactor.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 16:41:17 -07:00
Youssef Aitousarrah 8050d6764f fix(cache): track ohlcv_cache.py and data_cache files in git
These were untracked so CI couldn't import tradingagents.dataflows.data_cache.ohlcv_cache.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 16:41:17 -07:00
Aitous 893eb05349
Merge pull request #18 from Aitous/research/current
research: new strategy findings — 2026-04-14
2026-04-14 16:39:47 -07:00
Youssef Aitousarrah 65cd0bb094 fix(universe): add missing __init__.py for data_cache; switch to Russell 1000 via iShares
- tradingagents/dataflows/data_cache/__init__.py: fixes ModuleNotFoundError in CI
- universe.py: fetches Russell 1000 from iShares IWB CSV with weekly disk cache + fallback
- default_config.py: universe_source = 'russell1000'
- data/universe_cache.json: initial cache (weekly TTL, auto-refreshed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 16:36:17 -07:00
Youssef Aitousarrah f87197ef41 style: apply black/ruff formatting fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 16:21:13 -07:00
Youssef Aitousarrah e15e2df7a5 feat(cache): unified ticker universe + nightly OHLCV prefetch
- tradingagents/dataflows/universe.py: single source of truth for ticker
  universe; all scanners now call load_universe(config) instead of
  duplicating the 3-level fallback chain with hardcoded "data/tickers.txt"

- scripts/prefetch_ohlcv.py: nightly script using existing ohlcv_cache.py
  incremental logic; first run downloads 1y history, subsequent runs append
  only new trading days

- .github/workflows/prefetch.yml: runs at 01:00 UTC daily, before all other
  workflows; commits updated parquet to repo

- Updated 6 scanners: minervini, high_52w_breakout, ml_signal, options_flow,
  sector_rotation, technical_breakout — removed duplicate DEFAULT_TICKER_FILE
  constants and _load_tickers_from_file() functions

- minervini, high_52w_breakout, technical_breakout: replace yf.download()
  with download_ohlcv_cached() — reads from prefetched cache instead of
  hitting yfinance at discovery time

- default_config.py: added discovery.ohlcv_cache_dir config key

- data/ohlcv_cache/: initial 1y backfill (588 tickers, 5.4MB parquet)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 16:18:52 -07:00
github-actions[bot] 1dd00e467f research(autonomous): 2026-04-14 — automated research run 2026-04-14 21:17:06 +00:00
github-actions[bot] 17e77f036f research(autonomous): 2026-04-14 — automated research run 2026-04-14 13:47:21 -07:00
Youssef Aitousarrah 37029e554e fix(config): add missing earnings_beat and high_52w_breakout scanner configs
Both scanners were implemented by research PRs but never added to default_config.
Without entries they cannot be disabled or tuned from config and are invisible
to the settings UI. Also updated /research-strategy to make config entry mandatory.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 13:47:21 -07:00