June 3, 2026

52-Week Intelligence

A fully automated, agentic stock analysis engine that runs weekly LLM-powered market screeners. By utilizing agentic web search to identify contrarian value opportunities near 52-week lows and bearish/short candidates near 52-week highs, this engine handles extraction, scoring, schema validation, and database updates, before automatically deploying results to public dashboards.

System Architecture & Data Flow

The end-to-end flow of the automated screening process from initial scheduled agent execution to public web deployment.

flowchart TD subgraph ScreenerLoop ["Agent Execution Loop (Claude Code / Gemini CLI)"] A1[docs/52_WK_LOW_PROMPT.md] & A2[docs/52_WK_HIGH_PROMPT.md] --> B1[Web Search & Analysis] B1 --> C1[Write output/Y-M-D.json] style A1 fill:#ffcccc,stroke:#cc0000 style A2 fill:#ffcccc,stroke:#cc0000 end subgraph DBEngine ["Data Ingestion & Dashboards"] D1[scripts/push_results.py] -->|Schema Validation| E1[(MySQL Database)] C1 --> D1 C1 -->|Local PHP Preview| F1[output/ dashboards] E1 -->|Live Read| F1 style E1 fill:#ccffcc,stroke:#009900 end subgraph CloudDeployment ["Deployment Pipelines"] G1[GitHub Push] -->|Actions CI/CD| H1[FTP Deploy] F1 --> G1 end ScreenerLoop -. "Output Generation" .-> DBEngine DBEngine -. "Git Versioning" .-> CloudDeployment

Tip: Pinch to zoom or scroll horizontally if flowchart details are cut off.

The Live Dashboards

The system automatically generates responsive, elegant PHP dashboards displaying scored stock picks, investment theses, SWOT profiles, and live-updated prices.

ServiceNow low pick dashboard card

ServiceNow (NOW) analysis detail under the 52-Week Low Screener Dashboard, displaying SWOT and quant metrics.

Micron Technology high pick dashboard card

Micron Technology (MU) analysis detail under the 52-Week High Screener Dashboard, displaying cyclicality and catalyst flags.

Project Performance Metrics

Key performance indicators demonstrating the speed, automation capacity, and stability of the agentic engine.

0

Weekly Screeners

Concurrently running long and short evaluation runs.

0

Max Quant Score

Granular scoring across multiple risk and growth dimensions.

0

Zero API Cost %

Utilizes subscription-level terminal agent runs via CLI tool execution.

0

Top Picks Ranked

Strict ranking filter ensuring only highest conviction picks make the list.

The Implementation: How It Was Done

A walkthrough of the developmental phases required to construct this agentic stock screening engine.

1. Agent Prompt Engineering

Structuring the high-density markdown prompt instructions for the terminal agent.

2. Schema Validation & Database

Validating raw LLM JSON outputs via Pydantic and loading into a relational MySQL db.

3. CI/CD & PHP Dashboard

Auto-deploying updated code and static assets directly to Hostinger using GitHub Actions.

1. Agent Prompt Engineering

The core logic of the screeners is built inside two robust prompt files (52_WK_LOW_PROMPT.md and 52_WK_HIGH_PROMPT.md). Instead of traditional API scripts, the agent utilizes a terminal environment to execute system searches, download filings, and perform financial scoring of the candidates. The prompts enforce output consistency by demanding structured JSON containing quantitative fields, qualitative SWOT tags, and catalyst timelines.

Challenges Overcome

Overcoming structural and alignment difficulties in deploying agentic systems to production.

Conclusion & Future Outlook

The 52-Week Trade Screener demonstrates the potential of utilizing agentic AI for structured financial screening without incurring massive API platform costs. Future iterations will focus on automating the execution triggers via cloud-native cron triggers, setting up Webhook notifications on high-scoring candidates, and building an automated paper trading simulation to track the performance of the generated picks against the S&P 500 benchmark.