Claw-Screener
A stock screener that combines technical analysis (Williams %R oversold signals) with Warren Buffett-style fundamental analysis using SEC data. Supports US (S&P 500) and Thai (SET) markets.
When to Use This Skill
Use this skill when you need to:
- - Find oversold stocks with strong fundamentals
- Screen for quality stocks using Buffett's 10 formulas
- Screen for long-term compounders using Carlson filters (ROIC, growth, buybacks)
- Analyze individual stocks for investment decisions
- Get daily stock screening results in text, JSON, or Telegram format
Tools
This skill provides the following capabilities:
1. Combined Screening
Finds stocks that are both technically oversold (Williams %R < -80) and fundamentally strong (Buffett score >= threshold).
Command:
CODEBLOCK0
Options:
| Flag | Description | Default |
|---|
| INLINECODE0 | Market: us or INLINECODE2 | INLINECODE3 |
| INLINECODE4 |
Minimum Buffett score (0-10) |
5 |
|
--top-n | Number of results to show |
10 |
|
--format | Output:
text,
json,
telegram |
text |
Examples:
CODEBLOCK1
2. Technical Only Scan
Fast oversold scan using Williams %R indicator only. No SEC data required. Works for both US and Thai markets.
Command:
CODEBLOCK2
Options:
| Flag | Description | Default |
|---|
| INLINECODE13 | Market: us or INLINECODE15 | INLINECODE16 |
| INLINECODE17 |
Williams %R threshold |
-80 |
|
--top-n | Number of results to show |
20 |
|
--format | Output:
text,
json,
telegram |
text |
Examples:
CODEBLOCK3
3. Analyze Stock
Deep analysis of a single stock using Buffett's 10 formulas.
Command:
CODEBLOCK4
Options:
| Flag | Description | Default |
|---|
| INLINECODE26 | Output: text, json, INLINECODE29 | INLINECODE30 |
Examples:
CODEBLOCK5
4. Compounding Machine
Screens for "compounders" using Carlson-style filters:
- - Revenue and net income YoY trend strength
- ROIC threshold (default >15%)
- Share count reduction over 3 years (buyback signal)
- Operating margin threshold (default >20%)
- Includes current yield vs 5-year average and a simple 10-year DCF context
Command:
CODEBLOCK6
Options:
| Flag | Description | Default |
|---|
| INLINECODE31 | Market universe: us or INLINECODE33 | INLINECODE34 |
| INLINECODE35 |
Comma-separated tickers (overrides market universe) | - |
|
--max-tickers | Limit universe size | all |
|
--top-n | Number of passing stocks to show |
25 |
|
--concurrency | Parallel fetch workers |
4 |
|
--format | Output:
text or
json |
text |
|
--db-path | SQLite cache path |
sec_cache.db |
|
--ttl-days | Cache TTL in days |
7 |
|
--min-roic | ROIC threshold (%) |
15 |
|
--min-op-margin | Operating margin threshold (%) |
20 |
|
--min-buyback | Required 3Y share reduction (%) |
2 |
|
--show-rejected | Include failed tickers with reasons in output | off |
Examples:
CODEBLOCK7
Runtime / Caching Notes:
- - First uncached run on full US universe can take ~20-30+ minutes.
- This is expected: each ticker requires multiple Yahoo fundamentals/quote requests and retry backoff for rate-limit resilience.
- Subsequent runs are much faster due to SQLite caching (
sec_cache.db, TTL default 7 days). - For quick checks, run smaller scans first (for example
--max-tickers 50 or specific --tickers).
Agent Guidance for User Messaging:
- - If user runs full-universe Compounding Machine scan, explicitly warn that initial run may take ~20-30 minutes.
- Suggest quick-test alternatives while waiting:
-
bun run src/compoundingMachine.ts --max-tickers 50
- INLINECODE60
5. Watchlist Management
Track stocks you're interested in and get alerts when they become oversold or overbought.
Command:
CODEBLOCK8
Commands:
| Command | Description |
|---|
| INLINECODE61 | Add a stock to your watchlist |
| INLINECODE62 |
Remove a stock from your watchlist |
|
list | Show all watched stocks |
Options:
| Flag | Description | Default |
|---|
| INLINECODE64 | Market: us (US) or th (Thai) | INLINECODE67 |
| INLINECODE68 |
Optional notes for the stock | - |
|
--alert-threshold | Williams %R threshold for alerts | - |
Examples:
CODEBLOCK9
Storage: Watchlist is saved to INLINECODE70
Buffett's 10 Formulas
The fundamental analysis evaluates stocks against Warren Buffett's criteria:
| # | Formula | Target | Description |
|---|
| 1 | Cash Test | > Total Debt | Cash covers all debt |
| 2 |
Debt-to-Equity | < 0.5 | Low leverage |
| 3 | Return on Equity | > 15% | Efficient use of capital |
| 4 | Current Ratio | > 1.5 | Short-term liquidity |
| 5 | Operating Margin | > 12% | Operational efficiency |
| 6 | Asset Turnover | > 0.5 | Asset efficiency |
| 7 | Interest Coverage | > 3x | Ability to pay interest |
| 8 | Earnings Stability | Positive | Consistent profitability |
| 9 | Free Cash Flow | > 0 | Cash generation |
| 10 | Capital Allocation | > 15% ROE | Management effectiveness |
Scoring: Each passing formula earns 1 point. Maximum score: 10/10.
Technical Indicator
Williams %R (Williams Percent Range)
- - Range: -100 to 0
- Oversold: < -80 (potential buy signal)
- Overbought: > -20 (potential sell signal)
Combined Score Formula
Combined score = (Technical Score × 0.3) + (Fundamental Score × 0.7)
- - Technical Score: (Williams %R + 100) / 100
- Fundamental Score: (Buffett Score / 10) × 100
Data Sources
- - US Stocks: SEC EDGAR for fundamentals, Yahoo Finance for prices
- Thai Stocks: Yahoo Finance only (no SEC data available)
Installation
Runtime Requirements
- - Bun (>=1.3.1) - Required runtime for executing TypeScript scripts
- Node.js is NOT required as Bun provides all necessary runtime functionality
Install Bun
If you don't have Bun installed, run:
CODEBLOCK10
Install Dependencies
CODEBLOCK11
File Persistence
This skill creates and manages the following files:
| File | Location | Purpose | TTL |
|---|
| Watchlist | INLINECODE71 | User's stock watchlist | Permanent |
| SEC Cache |
sec_cache.db | Cached SEC EDGAR financial data | 7 days (default) |
| Price Cache |
price_cache.db | Cached stock price data | 1 day (default) |
Cache Management
- - Cache files are automatically created on first run
- Use
--ttl-days flag with compounding machine to adjust cache TTL - Cache files can be deleted to force fresh data fetch
- Cache improves performance significantly on subsequent runs
Notes
- - First run on full US universe can take ~20-30+ minutes (expected behavior)
- Subsequent runs are much faster due to caching
- For quick tests, use
--max-tickers 50 or specific INLINECODE76
Bun Scripts
CODEBLOCK12
Output Format Examples
Text (Default)
CODEBLOCK13
Telegram
CODEBLOCK14
爪形筛选器
一款结合技术分析(威廉%R超卖信号)与沃伦·巴菲特式基本面分析(基于SEC数据)的股票筛选器。支持美国(标普500)和泰国(SET)市场。
何时使用此技能
在以下情况下使用此技能:
- - 寻找基本面强劲的超卖股票
- 使用巴菲特10大公式筛选优质股票
- 使用卡尔森筛选器(ROIC、增长、回购)筛选长期复利股
- 分析个股以做出投资决策
- 以文本、JSON或Telegram格式获取每日股票筛选结果
工具
此技能提供以下功能:
1. 综合筛选
寻找同时满足技术超卖(威廉%R < -80)和基本面强劲(巴菲特评分 >= 阈值)的股票。
命令:
bun run src/screening.ts [选项]
选项:
| 标志 | 描述 | 默认值 |
|---|
| --market | 市场:us 或 bk | us |
| --min-score |
最低巴菲特评分(0-10) | 5 |
| --top-n | 显示结果数量 | 10 |
| --format | 输出格式:text、json、telegram | text |
示例:
bun run src/screening.ts
bun run src/screening.ts --market us --min-score 7 --top-n 5
bun run src/screening.ts --market bk
bun run src/screening.ts --format json
bun run src/screening.ts --format telegram
2. 纯技术扫描
仅使用威廉%R指标进行快速超卖扫描。无需SEC数据。适用于美国市场和泰国市场。
命令:
bun run src/technicalOnly.ts [选项]
选项:
| 标志 | 描述 | 默认值 |
|---|
| --market | 市场:us 或 bk | us |
| --threshold |
威廉%R阈值 | -80 |
| --top-n | 显示结果数量 | 20 |
| --format | 输出格式:text、json、telegram | text |
示例:
bun run src/technicalOnly.ts
bun run src/technicalOnly.ts --threshold -70 --top-n 50
bun run src/technicalOnly.ts --market bk
3. 分析股票
使用巴菲特10大公式对单只股票进行深度分析。
命令:
bun run src/analyze.ts <股票代码> [选项]
选项:
| 标志 | 描述 | 默认值 |
|---|
| --format | 输出格式:text、json、telegram | text |
示例:
bun run src/analyze.ts AAPL
bun run src/analyze.ts MSFT --format telegram
bun run src/analyze.ts GOOGL --format json
bun run src/analyze.ts PTT.BK
4. 复利机器
使用卡尔森式筛选器筛选复利股:
- - 营收和净利润同比趋势强度
- ROIC阈值(默认>15%)
- 3年内股份数量减少(回购信号)
- 营业利润率阈值(默认>20%)
- 包含当前收益率与5年均值对比,以及简单的10年DCF背景
命令:
bun run src/compoundingMachine.ts [选项]
选项:
| 标志 | 描述 | 默认值 |
|---|
| --market | 市场范围:us 或 bk | us |
| --tickers |
逗号分隔的股票代码(覆盖市场范围) | - |
| --max-tickers | 限制市场范围大小 | 全部 |
| --top-n | 显示通过的股票数量 | 25 |
| --concurrency | 并行获取工作线程数 | 4 |
| --format | 输出格式:text 或 json | text |
| --db-path | SQLite缓存路径 | sec_cache.db |
| --ttl-days | 缓存有效期(天) | 7 |
| --min-roic | ROIC阈值(%) | 15 |
| --min-op-margin | 营业利润率阈值(%) | 20 |
| --min-buyback | 要求的3年股份减少比例(%) | 2 |
| --show-rejected | 在输出中包含失败的股票及原因 | 关闭 |
示例:
bun run src/compoundingMachine.ts
bun run src/compoundingMachine.ts --tickers AAPL,MSFT,NVDA --top-n 10
bun run src/compoundingMachine.ts --format json --max-tickers 100
bun run src/compoundingMachine.ts --tickers PLTR --show-rejected
运行/缓存说明:
- - 首次未缓存运行完整美国市场可能需要约20-30+分钟。
- 这是正常现象:每只股票需要多次雅虎基本面/报价请求以及重试退避以应对速率限制。
- 由于SQLite缓存(sec_cache.db,默认TTL 7天),后续运行会快得多。
- 如需快速检查,先运行较小的扫描(例如 --max-tickers 50 或特定 --tickers)。
面向用户的代理指导:
- - 如果用户运行完整市场的复利机器扫描,明确警告首次运行可能需要约20-30分钟。
- 在等待期间建议快速测试替代方案:
- bun run src/compoundingMachine.ts --max-tickers 50
- bun run src/compoundingMachine.ts --tickers AAPL,MSFT,NVDA
5. 自选股管理
跟踪您感兴趣的股票,并在它们变得超卖或超买时获得提醒。
命令:
bun run src/watchList.ts <命令> [选项]
命令:
| 命令 | 描述 |
|---|
| add <股票代码> | 将股票添加到自选股 |
| remove <股票代码> |
从自选股中移除股票 |
| list | 显示所有自选股 |
选项:
| 标志 | 描述 | 默认值 |
|---|
| --market us\ | th | 市场:us(美国)或 th(泰国) | us |
| --notes ... |
股票的可选备注 | - |
| --alert-threshold | 威廉%R提醒阈值 | - |
示例:
bun run src/watchList.ts add AAPL
bun run src/watchList.ts add AAPL --market us --notes 大型科技股
bun run src/watchList.ts add PTT.BK --market th
bun run src/watchList.ts remove AAPL
bun run src/watchList.ts list
bun run src/watchList.ts list --market us
存储: 自选股保存至 ~/.claw-screener-watchlist.json
巴菲特10大公式
基本面分析根据沃伦·巴菲特的标准评估股票:
| # | 公式 | 目标 | 描述 |
|---|
| 1 | 现金测试 | > 总负债 | 现金覆盖所有债务 |
| 2 |
负债权益比 | < 0.5 | 低杠杆 |
| 3 | 净资产收益率 | > 15% | 资本使用效率 |
| 4 | 流动比率 | > 1.5 | 短期流动性 |
| 5 | 营业利润率 | > 12% | 运营效率 |
| 6 | 资产周转率 | > 0.5 | 资产效率 |
| 7 | 利息保障倍数 | > 3倍 | 支付利息能力 |
| 8 | 盈利稳定性 | 正数 | 持续盈利能力 |
| 9 | 自由现金流 | > 0 | 现金生成能力 |
| 10 | 资本配置 | > 15% ROE | 管理效率 |
评分: 每通过一个公式得1分。最高分:10/10。
技术指标
威廉%R(威廉百分比范围)
- - 范围:-100 到 0
- 超卖:< -80(潜在买入信号)
- 超买:> -20(潜在卖出信号)
综合评分公式
综合评分 =(技术评分 × 0.3)+(基本面评分 × 0.7)
- - 技术评分:(威廉%R + 100)/ 100
- 基本面评分:(巴菲特评分 / 10)× 100
数据来源
-