How tusharqlab/stock-alert-engine works
This is an automated NSE stock-alert engine, managed through configuration and a Colab alert-management notebook, with scans, daily summaries, history, and monthly Telegram archives. The normal scan path is explicit in main.py and run.py; run.py also dispatches separate summary and archive modes. Market data comes from Yahoo Finance, while alert definitions, settings, and Parquet history are file-backed. The notebook is a user-facing capability documented in the README, but its internals were not sampled. Edges reflect cited calls or README claims; omitted implementation details are not inferred.
Main entry points: run.py Scan orchestration · main.py Pipeline orchestration · paths.py Path resolution · notifier.py Notification formatting
Components 18
Scan workflow
- Scan orchestration
run.py - Pipeline orchestration
main.py - Market data fetch
engine/data_fetcher.py
Alert domain
- Alert evaluation
engine/alert_checker.py - Trendline calculation
engine/trendline.py
Configuration and history
- Alert definitions
config/alerts.json - Engine settings
config/config.yaml - Path resolution
engine/paths.py - History and archives
engine/history.py - Parquet history
data/alert_history.parquet
Reporting and delivery
- Daily summary
engine/summary.py - Notification formatting
engine/notifier.py
Alert management
- Colab alert manager
Alert_Manager.ipynb - Alert CRUD
engine/alert_manager.py
Other components
- Operator
- GitHub Actions schedule
- Yahoo Finance
- Telegram
Connections 35
- Operator → Colab alert manager: manages alerts
README.md - Colab alert manager → Alert CRUD: uses
- Alert CRUD → Alert definitions: reads and writes
engine/alert_manager.py - GitHub Actions schedule → Scan orchestration: dispatches
README.md - Operator → Scan orchestration: runs mode
run.py - Scan orchestration → Alert definitions: reads
run.py - Scan orchestration → Market data fetch: fetches data
run.py - Market data fetch → Yahoo Finance: fetches prices
engine/data_fetcher.py - Scan orchestration → Alert evaluation: checks alerts
run.py - Alert evaluation → Trendline calculation: calculates level
engine/alert_checker.py - Alert evaluation → Alert definitions: reads and updates
engine/alert_checker.py - Scan orchestration → History and archives: appends triggers
run.py - History and archives → Parquet history: reads and writes
engine/history.py - Scan orchestration → Notification formatting: sends alerts
run.py - Scan orchestration → Daily summary: builds summary
run.py - Scan orchestration → Notification formatting: sends summary
run.py - Notification formatting → Telegram: sends messages
engine/notifier.py - Operator → Pipeline orchestration: runs pipeline
main.py - Pipeline orchestration → Market data fetch: fetches data
main.py - Pipeline orchestration → Alert evaluation: checks alerts
main.py - Pipeline orchestration → History and archives: appends triggers
main.py - Pipeline orchestration → Notification formatting: sends notifications
main.py - Pipeline orchestration → Daily summary: builds summary
main.py - Pipeline orchestration → Notification formatting: sends summary
main.py - Operator → Scan orchestration: selects summary or archive
run.py - Scan orchestration → History and archives: creates archive
run.py - Scan orchestration → Notification formatting: sends archive
run.py - Path resolution → Engine settings: resolves settings path
engine/paths.py - Path resolution → Alert definitions: resolves alerts path
engine/paths.py - History and archives → Path resolution: gets storage paths
engine/history.py - Alert evaluation → Path resolution: gets config paths
engine/alert_checker.py - Market data fetch → Path resolution: gets config path
engine/data_fetcher.py - Notification formatting → Path resolution: gets config path
engine/notifier.py - Daily summary → History and archives: reads triggered history
engine/summary.py - Daily summary → Path resolution: gets config paths
engine/summary.py