TL;DR: I built a stock screening system that scans all 500 S&P 500 stocks for technical oversold signals, then runs Warren Buffett’s 10 quality formulas using official SEC data. The entire system runs from Telegram commands, uses 100% free public APIs, and returns results in 15 seconds to 3 minutes depending on the analysis depth.
The Problem: Wall Street Tools Are ExpensiveAs someone interested in quantitative investing, I faced a familiar dilemma: professional-grade stock screening tools are prohibitively expensive.
What I wanted was simple:
The solution? Build it myself using AI agents, free public APIs, and open-source tools.
The Architecture: AI-Powered AutomationThe system is built on OpenClaw, an AI agent framework that orchestrates complex workflows through natural language. Think of it as having a senior developer who can write code, manage databases, and deploy services — all from chat commands.
Core Components1. OpenClaw Agent (Orchestration Layer)
The brains of the operation. Claude Opus 4.5 interprets Telegram commands and executes Python scripts with full context awareness.
2. Python Scripts (Processing Layer)
3. SQLite Databases (Caching Layer)
4. Telegram Bot (Interface Layer)
Simple commands like oversold, screen, or analyze AAPL trigger full market scans.
500
S&P 500 Stocks Scanned
15s
Technical Scan Time
10
Buffett Formulas
$0
API Costs
Data Sources: Free, Public, and AuthoritativeOne of the key constraints was using 100% free data sources. Here’s what I chose and why:
1. Yahoo Finance (Price Data)Via the yfinance Python library, I get:
Reliability: 99.4% success rate (500/503 S&P 500 stocks)
Cost: Free, no API key required
2. SEC EDGAR (Fundamental Data)The U.S. Securities and Exchange Commission provides a free API for company financial statements. This is the official source — the same data Warren Buffett reads in 10-K filings.
import requests# Fetch Apple's company facts (balance sheet, income statement, cash flow)Authority: 100% official government data, legally required filings
Cost: Free, rate limit of 10 requests/second
3. GitHub (S&P 500 List)A community-maintained CSV file with all current S&P 500 constituents:
import pandas as pdurl = "https://raw.githubusercontent.com/datasets/s-and-p-500-companies/main/data/constituents.csv"This is the speed demon. In 15–30 seconds, it scans all 500 S&P 500 stocks and identifies which ones are technically oversold.
What It DoesWilliams %R measures where the current price sits within the recent 21-day high-low range:
Williams %R = ((Highest High - Close) / (Highest High - Lowest Low)) × -100Interpretation:
When a stock hits -99.3 (like Visa did in my scan), it means the price is only 0.7% above the 21-day low — extreme panic selling territory.
Real Results (Jan 31, 2026):