Commit Graph

359 Commits

Author SHA1 Message Date
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
Youssef Aitousarrah d282bd8d10 feat(research): use Jina Reader for all web fetching in research-strategy
All WebFetch calls now route through r.jina.ai for JS-rendered, clean markdown.
arXiv uses structured API endpoint for discovery. Reddit threads fetched via
Jina after URL discovery with WebSearch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 13:47:21 -07:00
Youssef Aitousarrah 7ffbadca09 fix(hypotheses): prune concluded entries from active.json after each run
Concluded hypotheses already live in concluded/ — keeping them in active.json
causes the registry to grow unboundedly. Runner now removes them at the end
of each cycle. Also cleaned up the existing social_dd concluded entry.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 13:47:21 -07:00
Youssef Aitousarrah 97b2755e97 chore: rename research-strategy workflow to Daily 2026-04-14 13:47:21 -07:00
Aitous 4ff1251323
Merge pull request #16 from Aitous/iterate/current
learn(iterate): automated improvements — 2026-04-14
2026-04-14 13:13:14 -07:00
Youssef Aitousarrah 07345d9c4f feat(iterate): enforce file writes + auto-register hypotheses; research daily
- iterate: CRITICAL note that all writes must use file tools, not narration
- iterate: new Step 5.5 — auto-registers one forward-test hypothesis per run
  when a code change needs live-data validation
- research-strategy: cron changed from Monday-only to daily at 07:00 UTC

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 13:08:52 -07:00
Youssef Aitousarrah 298db90a14 chore(hypotheses): reduce min_days thresholds for faster conclusions
insider_buying-min-txn-100k: 21 → 14 days.
Command defaults: ≥2/day → 10d, 1/day → 14d, <1/day → 21d.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 12:58:02 -07:00
github-actions[bot] 3c1d1a2f1a chore: update performance tracking 2026-04-14 2026-04-14 14:25:52 +00:00
github-actions[bot] 53e812a1c1 chore: daily discovery 2026-04-14 2026-04-14 14:25:46 +00:00
github-actions[bot] 3bfb8cc47d chore(hypotheses): update registry 2026-04-14 2026-04-14 09:22:54 +00:00
github-actions[bot] f862e91870 learn(iterate): 2026-04-14 — automated iteration run 2026-04-14 07:25:30 +00:00
Youssef Aitousarrah fa322bf784 hypothesis(social_dd): register ranker suppression statistical hypothesis
Analysis of 25 picks reveals 60% 30d win rate (+2.32%) vs 41.7% 7d (-1.92%).
Score suppression is not the primary issue (avg score 71.5, 22/25 >= 65).
Root cause is evaluation horizon mismatch — ranker calibrated on 7d outcomes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 12:40:33 -07:00
Youssef Aitousarrah 662fdb5753 feat(hypotheses): uncap statistical hypotheses from max_active limit
Statistical hypotheses now conclude immediately on the next runner cycle
without counting toward max_active. Only implementation hypotheses occupy
runner slots. Added conclude_statistical_hypothesis() for instant analysis
against existing performance data with Gemini LLM enrichment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 12:40:33 -07:00
Aitous 79a58a540c
Merge pull request #14 from Aitous/iterate/current
learn(iterate): automated improvements — 2026-04-13
2026-04-13 12:06:56 -07:00
Aitous da541f0b77
Merge pull request #15 from Aitous/research/current
research: new strategy findings — 2026-04-13
2026-04-13 12:05:01 -07:00
github-actions[bot] 70e1264af3 chore: update performance tracking 2026-04-13 2026-04-13 14:20:23 +00:00
github-actions[bot] 1fccc3a85a chore: daily discovery 2026-04-13 2026-04-13 14:20:11 +00:00
github-actions[bot] a13ddffe8f chore(hypotheses): update registry 2026-04-13 2026-04-13 10:03:03 +00:00
github-actions[bot] 48a1c1672f research(autonomous): 2026-04-13 — automated research run 2026-04-13 09:06:49 +00:00
github-actions[bot] 17e45df41a learn(iterate): 2026-04-13 — automated iteration run 2026-04-13 07:52:59 +00:00
Aitous ddb2a010e7
Merge pull request #13 from Aitous/research/current
research: short squeeze scanner — 2026-04-12
2026-04-12 19:21:25 -07:00
Youssef Aitousarrah f73681cf1c research(short-squeeze): 2026-04-12 — new short_squeeze scanner; high SI (>20%) as squeeze-risk discovery for cross-scanner confluence
Implements ShortSqueezeScanner wrapping existing get_short_interest() in finviz_scraper.py.
Research finding: raw high SI predicts negative long-term returns (academic); edge is using
SI as a squeeze-risk flag when combined with earnings_calendar or options_flow catalysts.
Directly addresses earnings_calendar pending hypothesis (APLD 30.6% SI was strongest setup).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 19:10:36 -07:00
Youssef Aitousarrah a51d6193f8 research(short-squeeze): 2026-04-12 — new short_squeeze scanner; high SI (>20%) as squeeze-risk discovery for cross-scanner confluence
Implements ShortSqueezeScanner wrapping existing get_short_interest() in finviz_scraper.py.
Research finding: raw high SI predicts negative long-term returns (academic); edge is using
SI as a squeeze-risk flag when combined with earnings_calendar or options_flow catalysts.
Directly addresses earnings_calendar pending hypothesis (APLD 30.6% SI was strongest setup).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 19:10:30 -07:00
Youssef Aitousarrah 612366fa45 learn(iterate): 2026-04-12 — document social_dd/early_accumulation; split social_dd from social_hype in ranker (55% 30d win rate vs 14.3%)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 19:03:03 -07:00
Aitous 50889fd667
Merge pull request #10 from Aitous/iterate/current
learn(iterate): automated improvements — 2026-04-12
2026-04-12 18:56:47 -07:00
Youssef Aitousarrah a9389043ac fix: target Aitous/TradingAgents repo for all automated PRs
gh pr create/list/edit were defaulting to TauricResearch (upstream).
Added --repo Aitous/TradingAgents to all gh calls in iterate,
research-strategy workflows and slash commands.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 18:53:04 -07:00
Youssef Aitousarrah 2d8b91b709 learn(iterate): 2026-04-12 — surface worst-performing strategies in ranker context; LLM now sees news_catalyst (0% 7d win rate) and social_hype (14.3%) as explicit penalties
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 18:04:46 -07:00
Youssef Aitousarrah 7ec0e52b98 learn(iterate): 2026-04-12 — raise score threshold 55→65; minervini leads; insider_buying staleness pattern identified
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 18:04:46 -07:00
Youssef Aitousarrah 7585da3ac6 chore: sync local modifications
- active.json: updated days_elapsed from hypothesis runner
- hypotheses.py: black formatting applied by pre-commit hook
- .gitignore: local additions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 18:04:38 -07:00
Youssef Aitousarrah 5b13e25adc feat(hypotheses): use gemini-3-flash-preview for LLM analysis
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 18:04:38 -07:00