Commit Graph

95 Commits

Author SHA1 Message Date
github-actions[bot] 656442ceec chore: update performance tracking 2026-03-03 2026-03-03 13:44:43 +00:00
github-actions[bot] d3ce8c2ea3 chore: daily discovery 2026-03-03 2026-03-03 13:43:30 +00:00
github-actions[bot] 6996af4577 chore: update performance tracking 2026-03-02 2026-03-02 13:44:36 +00:00
github-actions[bot] 33f932f6e0 chore: daily discovery 2026-03-02 2026-03-02 13:43:55 +00:00
github-actions[bot] 8b8b0ab3f5 chore: update performance tracking 2026-03-01 2026-03-01 13:20:37 +00:00
github-actions[bot] b12040f3d6 chore: daily discovery 2026-03-01 2026-03-01 13:19:55 +00:00
github-actions[bot] db332b3033 chore: update performance tracking 2026-02-28 2026-02-28 13:17:50 +00:00
github-actions[bot] 41684c36e0 chore: daily discovery 2026-02-28 2026-02-28 13:17:14 +00:00
github-actions[bot] 151b841fd4 chore: update performance tracking 2026-02-27 2026-02-27 13:40:57 +00:00
github-actions[bot] dabec2130e chore: daily discovery 2026-02-27 2026-02-27 13:40:48 +00:00
github-actions[bot] 6273c2c94c chore: update performance tracking 2026-02-26 2026-02-26 13:53:17 +00:00
github-actions[bot] 4b47f23219 chore: daily discovery 2026-02-26 2026-02-26 13:52:36 +00:00
github-actions[bot] bd3086f044 chore: update performance tracking 2026-02-25 2026-02-25 13:51:31 +00:00
github-actions[bot] bc3c5e729e chore: daily discovery 2026-02-25 2026-02-25 13:51:20 +00:00
github-actions[bot] 3d9c43343b chore: update performance tracking 2026-02-24 2026-02-24 13:51:30 +00:00
github-actions[bot] 9e9550f4aa chore: daily discovery 2026-02-24 2026-02-24 13:51:19 +00:00
github-actions[bot] 25de155d0b chore: update performance tracking 2026-02-23 2026-02-23 13:56:54 +00:00
github-actions[bot] 576f264c85 chore: daily discovery 2026-02-23 2026-02-23 13:55:47 +00:00
github-actions[bot] ac07e23882 chore: update performance tracking 2026-02-22 2026-02-22 13:31:47 +00:00
github-actions[bot] 41f457bd12 chore: daily discovery 2026-02-22 2026-02-22 13:31:02 +00:00
github-actions[bot] 592fe798ec chore: update performance tracking 2026-02-21 2026-02-21 13:25:44 +00:00
github-actions[bot] 01e16e987f chore: daily discovery 2026-02-21 2026-02-21 13:24:48 +00:00
Youssef Aitousarrah 8e2392029a Update 2026-02-20 08:39:37 -08:00
Youssef Aitousarrah ec8309a34e Update 2026-02-20 08:38:15 -08:00
github-actions[bot] 6342090a94 chore: update performance tracking 2026-02-20 2026-02-20 13:46:52 +00:00
github-actions[bot] 4f26536f46 chore: daily discovery 2026-02-20 2026-02-20 13:46:15 +00:00
github-actions[bot] aadb54e776 chore: update performance tracking 2026-02-19 2026-02-19 13:55:01 +00:00
github-actions[bot] 89c23751fa chore: daily discovery 2026-02-19 2026-02-19 13:54:25 +00:00
github-actions[bot] 4355f633b3 chore: update performance tracking 2026-02-18 2026-02-18 13:51:57 +00:00
github-actions[bot] a29cb9ca18 chore: daily discovery 2026-02-18 2026-02-18 13:51:26 +00:00
github-actions[bot] 60a4fdd98d chore: update performance tracking 2026-02-17 2026-02-17 13:51:48 +00:00
github-actions[bot] 743ef2c56e chore: daily discovery 2026-02-17 2026-02-17 13:50:40 +00:00
github-actions[bot] e3f3c02dc9 chore: daily discovery 2026-02-16 2026-02-16 14:32:42 +00:00
github-actions[bot] 18f6907857 chore: daily discovery 2026-02-13 2026-02-13 14:20:20 +00:00
github-actions[bot] 85ec1cb88f chore: daily discovery 2026-02-12 2026-02-12 14:38:41 +00:00
github-actions[bot] 53078c6319 chore: daily discovery 2026-02-12 2026-02-12 14:22:14 +00:00
github-actions[bot] 54f5af2036 chore: daily discovery 2026-02-12 2026-02-12 06:47:07 +00:00
Youssef Aitousarrah f4aceef857 feat: add daily discovery workflow, recommendation history, and scanner improvements
- Add GitHub Actions workflow for daily discovery (8:30 AM ET, weekdays)
- Add headless run_daily_discovery.py script for scheduling
- Expand options_flow scanner to use tickers.txt with parallel execution
- Add recommendation history section to Performance page with filters and charts
- Fix strategy name normalization (momentum/Momentum/Momentum-Hype → momentum)
- Fix strategy metrics to count all recs, not just evaluated ones
- Add error handling to Streamlit page rendering

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 22:07:02 -08:00
Youssef Aitousarrah 8ebb42114d Add recommendations folder so that the UI can display it 4 2026-02-10 22:28:52 -08:00
Youssef Aitousarrah 0bc7dda086 Add recommendations folder so that the UI can display it 3 2026-02-10 09:43:54 -08:00
Youssef Aitousarrah 50eee9b945 Add recommendations folder so that the UI can display it 2 2026-02-09 23:53:55 -08:00
Youssef Aitousarrah 8273870e0a Add recommendations folder so that the UI can display it 2026-02-09 23:41:57 -08:00
Youssef Aitousarrah 43bdd6de11 feat: discovery pipeline enhancements with ML signal scanner
Major additions:
- ML win probability scanner: scans ticker universe using trained
  LightGBM/TabPFN model, surfaces candidates with P(WIN) above threshold
- 30-feature engineering pipeline (20 base + 10 interaction features)
  computed from OHLCV data via stockstats + pandas
- Triple-barrier labeling for training data generation
- Dataset builder and training script with calibration analysis
- Discovery enrichment: confluence scoring, short interest extraction,
  earnings estimates, options signal normalization, quant pre-score
- Configurable prompt logging (log_prompts_console flag)
- Enhanced ranker investment thesis (4-6 sentence reasoning)
- Typed DiscoveryConfig dataclass for all discovery settings
- Console price charts for visual ticker analysis

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 22:53:42 -08:00
Youssef Aitousarrah 369f8c444b feat: discovery system code quality improvements and concurrent execution
Implement comprehensive code quality improvements and performance optimizations
for the discovery pipeline based on code review findings.

## Key Improvements

### 1. Common Utilities (DRY Principle)
- Created `tradingagents/dataflows/discovery/common_utils.py`
- Extracted ticker parsing logic (eliminates 40+ lines of duplication)
- Centralized stopwords list (71 common non-ticker words)
- Added ReDoS protection (100KB text length limit)
- Provides `validate_candidate_structure()` for output validation

### 2. Scanner Output Validation
- Two-layer validation approach:
  - Registration-time: Check scanner class structure
  - Runtime: Validate each candidate dictionary
- Added `scan_with_validation()` wrapper in BaseScanner
- Validates required keys: ticker, source, context, priority
- Graceful error handling with structured logging

### 3. Configuration-Driven Design
- Moved magic numbers to `default_config.py`:
  - `ticker_universe`: Top 20 liquid options tickers
  - `min_volume`: 1000 (options flow threshold)
  - `min_transaction_value`: $25,000 (insider buying filter)
- Fixed hardcoded absolute paths to relative paths
- Improved portability across development environments

### 4. Concurrent Scanner Execution (37% Performance Gain)
- Implemented ThreadPoolExecutor for parallel scanner execution
- Configuration: `scanner_execution.concurrent`, `max_workers`, `timeout_seconds`
- Performance: 42s vs 67s (37% faster with 8 scanners)
- Thread-safe state management (each scanner gets copy)
- Per-scanner timeout with graceful degradation
- Error isolation (one failure doesn't stop others)

### 5. Error Handling Improvements
- Changed bare `except:` to `except Exception:` (avoid catching KeyboardInterrupt)
- Added structured logging with `exc_info=True` and extra fields
- Implemented graceful degradation throughout pipeline

## Files Changed

### Core Implementation
- `tradingagents/__init__.py` (NEW) - Package initialization
- `tradingagents/default_config.py` - Scanner execution config, magic numbers
- `tradingagents/graph/discovery_graph.py` - Concurrent execution logic
- `tradingagents/dataflows/discovery/common_utils.py` (NEW) - Shared utilities
- `tradingagents/dataflows/discovery/scanner_registry.py` - Validation wrapper
- `tradingagents/dataflows/discovery/scanners/*.py` - Use common utilities

### Testing & Documentation
- `tests/test_concurrent_scanners.py` (NEW) - Comprehensive test suite
- `verify_concurrent_execution.py` (NEW) - Performance verification
- `CONCURRENT_EXECUTION.md` (NEW) - Implementation documentation

## Test Results

All tests passing (exit code 0):
-  Concurrent execution: 42s, 66-69 candidates
-  Sequential fallback: 56-67s, 65-68 candidates
-  Timeout handling: Graceful degradation with 1s timeout
-  Error isolation: Individual failures don't cascade

## Performance Impact

- Scanner execution: 37% faster (42s vs 67s)
- Time saved: ~25 seconds per discovery run
- At scale: 4+ minutes saved daily in production
- Same candidate quality (65-69 tickers in both modes)

## Breaking Changes

None. Concurrent execution is opt-in via config flag.
Sequential mode remains available as fallback.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 23:27:01 -08:00
Youssef Aitousarrah 5cf57e5d97 Update 2025-12-02 20:49:42 -08:00