Stock Crash Opportunity Monitor
Automated equity anomaly detector for Indian markets (NSE/BSE) utilizing Google Gemini AI event classification and a 10-factor opportunity scoring engine.
Project Overview & Architecture
The Stock Crash Opportunity Monitor is an automated equity research and anomaly-detection application developed for the Indian stock market (NSE and BSE). Built with Python and tailored for desktop execution on Windows, the system monitors listed securities for severe, sudden price drops, systematically analyzes the root drivers behind the decline, and computes an objective Opportunity Score to distinguish irrational market panic from permanent fundamental destruction.
In financial markets, sudden equity price crashes typically stem from two divergent causes: temporary external panics (such as macro rumors, broader sector contagion, or minor operational delays) which often present favorable value entry points, or severe internal impairments (such as accounting fraud, regulatory sanctions, or terminal product obsolescence) which represent catastrophic value traps. The Stock Crash Opportunity Monitor replaces emotional decision-making with a systematic two-stage diagnostic pipeline.
In the first stage, the application monitors exchange price feeds using yfinance. When a qualifying intraday or multi-day crash occurs, the system automatically pulls breaking financial reporting through Google News RSS feeds and submits the corpus to Google Gemini (gemini-1.5-flash). The AI model operates under strict evaluation constraints, classifying the incident into structured risk categories and assessing the likelihood that the event is temporary rather than terminal. Crucially, the system enforces programmatic safeguards: Event Nature is derived through code logic rather than trusting raw model outputs, and any indication of corporate governance failure acts as an immediate, non-negotiable disqualifier.
In the second stage, qualifying candidates pass through a deterministic 100-point scoring algorithm distributed evenly across ten fundamental and quantitative factors:
1. Business Quality (10%): Return on Equity (ROE) consistency.
2. Balance Sheet Strength (10%): Debt-to-EBITDA solvency ratios.
3. Cash Flow Quality (10%): Operating cash flow relative to net reported income.
4. Reason for Crash (10%): Root-cause event taxonomy.
5. Temporary Event Probability (10%): Likelihood of operational recovery.
6. Fundamental Damage (10%): Impairment to long-term earnings power.
7. Market Overreaction (10%): Magnitude of fall relative to historical volatility.
8. Valuation Attractiveness (10%): Price-to-Earnings compression vs historical medians.
9. Recovery Catalysts (10%): Identification of near-term inflection points.
10. Data Confidence (10%): Data completeness score.
Alerts are routed through a tiered notification system (NORMAL, WATCH, INVESTIGATE, POTENTIAL OPPORTUNITY, and EXCEPTIONAL OPPORTUNITY) leveraging native Windows Action Center Toast notifications and audio chimes. Disclaimer: The software functions strictly as an independent research aid; it contains no brokerage execution APIs and never places automatic market trades.