Add complete Slingshot stock scanner implementation#4
Conversation
Implement a comprehensive stock scanner that identifies high-probability "slingshot" setups by combining technical compression, smart money activity, and theme/narrative strength. Features: - Technical compression analysis (BB squeeze, ATR, volume dry-up, price range) - Smart money tracking (13F stubs, insider trades, options flow) - Theme management with 10 predefined baskets (AI, Semiconductors, Cloud, etc.) - Narrative scoring based on news sentiment - Full CLI interface with scan, ticker deep-dive, and theme listing - Comprehensive test suite (28 tests, all passing) Architecture: - models.py: Core data structures - compression.py: Technical compression detection - smart_money.py: Smart money tracking (stubs for production APIs) - theme_manager.py: Theme baskets and narrative scoring - data_fetcher.py: Market data via yfinance (optional import) - scoring_engine.py: Main orchestration and scoring logic - __main__.py: CLI interface The scanner combines three dimensions: 1. Compression (40%): Coiled spring technical patterns 2. Smart Money (35%): Institutional/insider accumulation 3. Theme (25%): Strong narratives and news momentum Ready for local testing and production API integration.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Add defensive checks for empty data series in BB squeeze and ATR compression calculations to prevent IndexError on .iloc[-1] access. Changes: - Add len() check before processing in calculate_bb_squeeze_score() - Add len() check before processing in calculate_atr_compression_score() - Validate historical data before indexing - Return neutral score (50.0) for empty/invalid data Fixes: Empty series crash discovered during edge case testing All 28 unit tests + 15 edge case tests now pass
There was a problem hiding this comment.
Pull request overview
This PR introduces a complete stock scanner implementation called "Slingshot" that identifies high-probability trading setups by analyzing three key dimensions: technical compression (coiled spring patterns), smart money activity (institutional/insider buying and options flow), and theme/narrative strength (sector momentum and news sentiment). The scanner combines these signals with configurable weights (40% compression, 35% smart money, 25% theme) to generate a unified score for each ticker.
Key Changes
- Implements comprehensive scoring system with technical indicators (Bollinger Bands, ATR, volume analysis)
- Adds smart money tracking infrastructure with stub implementations for 13F filings, insider trades, and options flow
- Provides CLI interface with scan, deep-dive, and theme listing commands
- Includes 28 unit tests across all major modules
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| slingshot/slingshot/models.py | Core data structures for compression, smart money, theme data, and scoring results |
| slingshot/slingshot/compression.py | Technical analysis functions for Bollinger Band squeeze, ATR, volume, and price range compression |
| slingshot/slingshot/smart_money.py | Smart money tracking with stub implementations for institutional, insider, and options flow analysis |
| slingshot/slingshot/theme_manager.py | Theme basket management with 10 predefined themes and news sentiment scoring (stub implementation) |
| slingshot/slingshot/data_fetcher.py | Market data fetching via yfinance with caching and ticker validation |
| slingshot/slingshot/scoring_engine.py | Main orchestration engine that combines all scoring dimensions and provides scanning functionality |
| slingshot/slingshot/main.py | CLI interface with scan, ticker deep-dive, and theme listing commands |
| slingshot/slingshot/init.py | Package initialization with public API exports |
| slingshot/tests/test_compression.py | Unit tests for compression analysis functions with simulated market data |
| slingshot/tests/test_smart_money.py | Unit tests for smart money tracking including caching behavior |
| slingshot/tests/test_theme_manager.py | Unit tests for theme management and narrative scoring |
| slingshot/tests/test_scoring_engine.py | Unit tests for the main scoring engine with mocked dependencies |
| slingshot/tests/init.py | Test suite package initialization |
| slingshot/setup.py | Package setup configuration with dependencies and entry points |
| slingshot/requirements.txt | Project dependencies listing |
| slingshot/README.md | Comprehensive documentation with usage examples, architecture overview, and extension guide |
Comments suppressed due to low confidence (1)
slingshot/slingshot/data_fetcher.py:154
- Except block directly handles BaseException.
except:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot open a new pull request to apply changes based on the comments in this thread |
Implement a comprehensive stock scanner that identifies high-probability
"slingshot" setups by combining technical compression, smart money activity,
and theme/narrative strength.
Features:
Architecture:
The scanner combines three dimensions:
Ready for local testing and production API integration.