Automated Intelligence Platform

StockOpportunity

A fully automated stock analysis engine that monitors markets 24/7, scores every tracked stock across 8 independent analysis modules, and delivers precision alerts when a high-probability investment opportunity is detected.

At a Glance

StockOpportunity runs as two independent processes — an analysis engine and a live dashboard — working together around the clock.

10
Stocks Tracked
8
Analysis Modules
Daily Runs
75
BUY Threshold
5
Data Sources

Scheduler (Background Engine)

  • Fetches live market data every 4 hours
  • Runs all 8 analysis modules per stock
  • Calculates weighted opportunity score
  • Sends email alert when score ≥ 75
  • Saves all results to database

Dashboard (Web UI)

  • Live view of all scored stocks
  • Per-stock signal breakdown
  • 30-day score history per stock
  • Full alert history with delivery status
  • Works even when engine is paused

Tracked Stocks (Initial Universe)

AAPL  ·  MSFT  ·  GOOGL  ·  AMZN  ·  NVDA  ·  META  ·  BRK.B  ·  JPM  ·  V  ·  JNJ

Easily extended — add any ticker to the Stocks table.

Alert Delivery

When a stock crosses the 75/100 threshold, an HTML email is delivered instantly via SendGrid — including the score, confidence, and the top signals that triggered the alert.

1How the Scheduler Works

The Scheduler is a .NET Worker Service powered by Quartz.NET. It runs two jobs that together keep the data fresh and the scores current — six times per day.

Job 1 — Data Ingestion

Runs at 00:00, 04:00, 08:00, 12:00, 16:00, 20:00 UTC

Prices — Yahoo Finance

Fetches 1 year of daily OHLCV data every run. Free, no key required.

Fundamentals — FMP

Quarterly income, balance sheet, cash flow, and ratios. Refreshed weekly (saves API quota).

News — Polygon.io + OpenAI

Fetches last 10 headlines per stock. Only new articles are sent to OpenAI for sentiment scoring (−1.0 to +1.0). Duplicate headlines are skipped automatically.

Insider Filings — SEC EDGAR

Form 4 filings from the last 90 days. Refreshed weekly. Classifies each filing as BUY or SELL.

Job 2 — Daily Analysis

Runs at 00:30, 04:30, 08:30, 12:30, 16:30, 20:30 UTC

Starts 30 minutes after Job 1 so fresh data is already in the database.

Run all 8 modules in parallel

Each module reads from the database and returns a score (0–100) with signals.

Calculate weighted score

The Score Engine combines all module scores into a single final score (0–100).

Save results to database

Every module result and the final opportunity score are persisted for the dashboard.

Fire alert if score ≥ 75

Sends an HTML email via SendGrid with the score, confidence, and top signals.

Startup Behaviour

When the Scheduler starts, Data Ingestion fires immediately and Analysis fires 2 minutes later — so the system is fully operational within minutes of launch without waiting for the next scheduled window.

2The 8 Analysis Modules

Every module runs independently, returns a score from 0 to 100, a confidence level, and a list of human-readable signals that explain the score. Modules never crash the system — a data failure returns a neutral 50 with low confidence.

Financial Health
Source: Financial Modeling Prep (FMP)
25%
✓ Implemented
Analyses the last 5 quarters of financials. Scores profitability (net income > 0), quarter-over-quarter revenue growth, free cash flow health, and debt leverage (Debt/EBITDA ratio). A profitable, growing, cash-generating company with low debt scores near 100.
Valuation
Source: Financial Modeling Prep (FMP)
20%
✓ Implemented
Evaluates how cheaply the market is pricing the company today using three ratios: P/E (price-to-earnings), P/S (price-to-sales), and EV/EBITDA (enterprise value). Low ratios indicate undervaluation and score higher.
Momentum
Source: Yahoo Finance (price history)
20%
✓ Implemented
Uses up to 200 days of daily prices to compute technical indicators: MA50 / MA200 (trend direction / golden cross), RSI(14) (overbought/oversold), MACD (momentum shift), volume spikes, and 20-day price return.
Sentiment
Source: Polygon.io + OpenAI gpt-4o-mini
10%
✓ Implemented
Reads news headlines from the last 7 days stored in the database. Each headline was scored by OpenAI during ingestion (−1.0 = very negative, +1.0 = very positive). The module averages those scores: score = 50 + (avg_sentiment × 40).
Institutional / Insider Activity
Source: SEC EDGAR Form 4 filings
10%
✓ Implemented
Tracks insider buy/sell transactions from the last 90 days using SEC Form 4 filings. More insider buying relative to selling pushes the score above 50. All insider selling scores 20; all buying scores 80. Insider behaviour is a strong leading signal.
Leadership Quality
Source: OpenAI (qualitative)
10%
⏳ Stub — returns neutral 50
Planned: uses OpenAI to qualitatively assess CEO track record, management team stability, insider ownership percentage, and capital allocation history. Pending implementation.
Economic Moat
Source: OpenAI (qualitative)
Signals only
⏳ Stub — returns neutral 50
Planned: qualitative assessment of competitive advantages — patents, network effects, switching costs, brand dominance. Moat signals surface in alerts and the dashboard even without affecting the weighted score.
Macro Environment
Source: Sector ETF data
5%
⏳ Stub — returns neutral 50
Planned: compares the stock's sector ETF trend to the broader market and checks alignment with macro themes (AI/tech, energy transition, financials cycle). A tailwind in the sector boosts the overall score.

3The Score Engine

After all 8 modules run, the Score Engine combines their scores into a single opportunity score using a weighted average formula.

Final Score  =  Σ ( module_score × weight )  ÷  Σ ( weights )

Example:
  FinancialHealth  82 × 0.25  =  20.5
  Valuation        61 × 0.20  =  12.2
  Momentum         74 × 0.20  =  14.8
  Sentiment        65 × 0.10  =   6.5
  Institutional    70 × 0.10  =   7.0
  Leadership       50 × 0.10  =   5.0   ← stub, neutral
  Macro            50 × 0.05  =   2.5   ← stub, neutral
  Moat             50 × 0.01  =   0.5   ← stub, signals only
  ─────────────────────────────────────
  Final Score  =  69.0 / 1.01  ≈  68.3

Confidence Score

Each module returns a confidence level (0–100%) alongside its score. Modules with more historical data report higher confidence (e.g. Momentum needs 200 days of prices for 95% confidence). If fewer than 5 modules contributed real data, the overall confidence is penalised proportionally.

Top Signals

The engine extracts the 5 most meaningful human-readable signals from the highest-scoring modules. These appear in the BUY alert email and on the dashboard — giving a clear, plain-English reason why the opportunity was flagged.

Recommendation Zones

✗ IGNORE   (0 – 49)
◎ WATCH   (50 – 74)
✓ BUY   (75 – 100)

Only BUY recommendations trigger an email alert. All scores are saved to the database and visible on the dashboard regardless of threshold.

4Data Sources & APIs

Five external data sources feed the system. All API keys are stored securely in configuration — never in code. All clients use automatic retry with exponential backoff if a request fails.

Source Data Provided Cost Frequency
Yahoo Finance Daily OHLCV prices (1 year history) Free Every run (6×/day)
Financial Modeling Prep Income statements, balance sheet, cash flow, P/E, P/S, EV/EBITDA Paid plan Once per week per stock
Polygon.io News headlines (last 10 articles per stock) Free tier Every run (6×/day)
OpenAI (gpt-4o-mini) Sentiment score (−1.0 to +1.0) per news headline Usage-based Only for new articles (~$0.002/stock/day)
SEC EDGAR Form 4 insider transactions (buys & sells, last 90 days) Free Once per week per stock

Resilience

Every API call is wrapped in Polly retry logic — 3 attempts with 2s / 4s / 8s exponential backoff. A failed data source never crashes a run.

Rate Limiting

300ms pause between stocks, 150ms pause between SEC XML fetches. FMP and SEC data is cached weekly to stay well within free-tier quotas.

Deduplication

News articles are deduplicated by title + date — OpenAI is only called for articles not already in the database, minimising token costs.

5Live Dashboard

A Blazor Server web application provides a real-time read-only view of all scores, signals, and alerts. Three pages cover the full picture.

/ — Opportunity Dashboard

Top 50 stocks ranked by latest score. Summary cards showing BUY / WATCH / IGNORE counts. Score badges, confidence bars, and the top signal per stock at a glance.

/stock/{symbol} — Stock Detail

Full breakdown for a single stock: KPI cards, all top signals, per-module score bars with individual signals, and a 30-day score history table.

/alerts — Alert History

All BUY alerts from the last 30 days with score, signals, and email delivery status. Clicking a row navigates to the full stock detail page.

2
BUY
5
WATCH
3
IGNORE
10
TRACKED
Symbol
Top Signal
Score
Confidence
Status
NVDA
MA50 above MA200 — golden cross
78.4
82%
BUY
MSFT
Revenue growth QoQ +12.3%
68.1
74%
WATCH
AAPL
RSI 32 — approaching oversold zone
61.5
68%
WATCH
META
MACD below signal line — bearish
44.2
55%
IGNORE

6Database

All data is stored in a SQL Server database. 8 tables cover everything from raw market data through to scored results and sent alerts.

TablePurposeWritten By
StocksUniverse of tracked stocks — Symbol, Name, Sector, ExchangeManual / seed
PricesDaily OHLCV snapshots from Yahoo FinanceDataIngestionJob
FinancialsQuarterly fundamentals — revenue, net income, EBITDA, debt, FCF, ratiosDataIngestionJob
NewsArticlesHeadlines from Polygon.io with OpenAI sentiment score (−1.0 to +1.0)DataIngestionJob
InsiderTransactionsSEC Form 4 filings — insider buys and sells with share count and priceDataIngestionJob
ModuleResultsPer-module score, confidence, and signals after each analysis runDailyAnalysisJob
OpportunityScoresFinal aggregated score per stock per run, with recommendation and top signalsDailyAnalysisJob
AlertsEvery triggered BUY alert with email and Telegram delivery statusDailyAnalysisJob

7Technology Stack

Purpose-built in C# .NET 8 for reliability, performance, and easy extension.

C# 12 / .NET 8

Language & runtime

SQL Server

Data persistence

Dapper

Lightweight SQL ORM

Quartz.NET

Job scheduling

Polly

Retry & resilience

SendGrid

Email delivery

Blazor Server

Real-time dashboard

OpenAI API

NLP sentiment

8Roadmap

The system is production-ready today. Planned enhancements will increase scoring depth and accessibility.

Near Term

  • ◯   Leadership module — OpenAI CEO scoring
  • ◯   Moat module — qualitative competitive moat assessment
  • ◯   Macro module — sector ETF trend alignment
  • ◯   Telegram alerts (code already in place)

Longer Term

  • ◯   Stock management UI (add/remove via dashboard)
  • ◯   Score trend chart (visual history)
  • ◯   Windows Service install for 24/7 hosting
  • ◯   FMP paid plan for live fundamental data
  • ◯   Expand stock universe beyond 10 tickers