value-dividend-screener by tradermonty/claude-trading-skills
npx skills add https://github.com/tradermonty/claude-trading-skills --skill value-dividend-screener此技能采用两阶段筛选方法,识别兼具价值特征、有吸引力的收入产生能力和持续增长的高质量股息股票:
基于包括估值比率、股息指标、财务健康状况和盈利能力在内的量化标准筛选美国股票。生成综合报告,按综合质量分数对股票进行排名,并提供详细的基本面分析。
效率优势:使用 FINVIZ 进行预筛选可以将 FMP API 调用减少 90%,这种方法非常适合免费层 API 用户。
当用户请求以下内容时调用此技能:
对于两阶段筛选(推荐):
检查两个 API 密钥是否都可用:
import os
fmp_api_key = os.environ.get('FMP_API_KEY')
finviz_api_key = os.environ.get('FINVIZ_API_KEY')
如果不可用,请要求用户提供 API 密钥或设置环境变量:
export FMP_API_KEY=your_fmp_key_here
export FINVIZ_API_KEY=your_finviz_key_here
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
检查 FMP API 密钥是否可用:
import os
api_key = os.environ.get('FMP_API_KEY')
如果不可用,请要求用户提供 API 密钥或设置环境变量:
export FMP_API_KEY=your_key_here
FINVIZ Elite API 密钥:
如果需要,请提供 references/fmp_api_guide.md 中的说明。
使用适当的参数运行筛选脚本:
使用 FINVIZ 进行预筛选,然后使用 FMP 进行详细分析:
默认执行(前 20 只股票):
python3 scripts/screen_dividend_stocks.py --use-finviz
使用显式 API 密钥:
python3 scripts/screen_dividend_stocks.py --use-finviz \
--fmp-api-key $FMP_API_KEY \
--finviz-api-key $FINVIZ_API_KEY
自定义前 N 名:
python3 scripts/screen_dividend_stocks.py --use-finviz --top 50
自定义输出位置:
python3 scripts/screen_dividend_stocks.py --use-finviz --output /path/to/results.json
脚本行为(两阶段):
预期运行时间(两阶段): 处理 30-50 个 FINVIZ 候选股票需要 2-3 分钟(比仅使用 FMP 快得多)
仅使用 FMP 股票筛选器 API(API 使用量较高):
默认执行:
python3 scripts/screen_dividend_stocks.py
使用显式 API 密钥:
python3 scripts/screen_dividend_stocks.py --fmp-api-key $FMP_API_KEY
脚本行为(仅使用 FMP):
预期运行时间(仅使用 FMP): 处理 100-300 个候选股票需要 5-15 分钟(适用速率限制)
API 使用量比较:
读取生成的 JSON 文件:
import json
with open('dividend_screener_results.json', 'r') as f:
data = json.load(f)
metadata = data['metadata']
stocks = data['stocks']
每只股票的关键数据点:
symbol、company_name、sector、market_cap、pricedividend_yield、pe_ratio、pb_ratiodividend_cagr_3y、revenue_cagr_3y、eps_cagr_3ypayout_ratio、fcf_payout_ratio、dividend_sustainabledebt_to_equity、current_ratio、financially_healthyroe、profit_margin、quality_scorecomposite_score为用户创建结构化的 Markdown 报告,包含以下部分:
# 价值股息股票筛选报告
**生成时间:** [时间戳]
**筛选标准:**
- 股息收益率:>= 3.5%
- 市盈率:<= 20
- 市净率:<= 2
- 股息增长(3年复合年增长率):>= 5%
- 收入趋势:3年内为正
- 每股收益趋势:3年内为正
**总结果:** [N] 只股票
---
## 按综合评分排名的前 20 只股票
| 排名 | 代码 | 公司 | 收益率 | 市盈率 | 股息增长 | 评分 |
|------|--------|---------|-------|-----|------------|-------|
| 1 | [TICKER] | [名称] | [%] | [X.X] | [%] | [XX.X] |
| ... |
---
## 详细分析
### 1. [SYMBOL] - [公司名称] (评分: XX.X)
**行业:** [行业名称]
**市值:** $[X.XX]B
**当前价格:** $[XX.XX]
**估值指标:**
- 股息收益率:[X.X]%
- 市盈率:[XX.X]
- 市净率:[X.X]
**增长概况(3年):**
- 股息复合年增长率:[X.X]% [✓ 持续 / ⚠ 一次削减]
- 收入复合年增长率:[X.X]%
- 每股收益复合年增长率:[X.X]%
**股息可持续性:**
- 派息比率:[XX]%
- 自由现金流派息比率:[XX]%
- 状态:[✓ 可持续 / ⚠ 监控 / ❌ 风险]
**财务健康:**
- 负债权益比:[X.XX]
- 流动比率:[X.XX]
- 状态:[✓ 健康 / ⚠ 谨慎]
**质量指标:**
- 净资产收益率:[XX]%
- 净利润率:[XX]%
- 质量评分:[XX]/100
**投资考量:**
- [关键优势 1]
- [关键优势 2]
- [风险因素或考量]
---
[为其他顶级股票重复]
---
## 投资组合构建指导
**多元化建议:**
- 前 20 名结果的行业细分
- 建议的配置策略
- 集中度风险警告
**监控建议:**
- 每季度跟踪的关键指标
- 每个持仓的警告信号
- 再平衡触发条件
**风险考量:**
- 市值集中度
- 结果中的行业偏差
- 经济敏感性警告
在解释结果时参考筛选方法论:
需要解释的关键概念:
加载 references/screening_methodology.md 以提供以下详细说明:
预测常见的用户问题:
"[某股票] 为什么没有进入列表?"
"我可以筛选特定行业吗?"
"如果我想要更高/更低的收益率阈值怎么办?"
"我应该多久重新运行一次这个筛选?"
"我应该买多少只股票?"
综合性筛选脚本,功能包括:
依赖项: requests 库(通过 pip install requests 安装)
速率限制: 内置延迟以遵守 FMP API 限制(免费层每天 250 次请求)
错误处理: 对缺失数据、速率限制重试、API 错误进行优雅降级
筛选方法的全面文档:
第一阶段:初始量化过滤器
第二阶段:增长质量过滤器
第三阶段:质量与可持续性分析
综合评分系统(0-100 分)
投资理念
使用说明和局限性
Financial Modeling Prep API 的完整指南:
API 密钥设置
使用的关键端点
速率限制策略
错误处理
数据质量考量
修改 scripts/screen_dividend_stocks.py 中的阈值:
第 383-388 行 - 初始筛选参数:
candidates = client.screen_stocks(
dividend_yield_min=3.5, # 调整收益率阈值
pe_max=20, # 调整市盈率阈值
pb_max=2, # 调整市净率阈值
market_cap_min=2_000_000_000 # 最小 20 亿美元市值
)
第 423 行 - 股息复合年增长率阈值:
if not div_cagr or div_cagr < 5.0: # 调整增长阈值
在初始筛选后添加行业过滤:
# 筛选特定行业
target_sectors = ['Consumer Defensive', 'Utilities', 'Healthcare']
candidates = [s for s in candidates if s.get('sector') in target_sectors]
房地产投资信托基金和金融股具有不同的股息特征(更高的派息率、不同的指标):
# 排除房地产投资信托基金和金融股
exclude_sectors = ['Real Estate', 'Financial Services']
candidates = [s for s in candidates if s.get('sector') not in exclude_sectors]
将 JSON 结果转换为 CSV 以便在 Excel 中分析:
import json
import csv
with open('dividend_screener_results.json', 'r') as f:
data = json.load(f)
stocks = data['stocks']
with open('screening_results.csv', 'w', newline='') as csvfile:
if stocks:
fieldnames = stocks[0].keys()
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
writer.writeheader()
writer.writerows(stocks)
解决方案: 安装 requests 库
pip install requests
解决方案: 设置环境变量或通过命令行提供
export FMP_API_KEY=your_key_here
# 或
python3 scripts/screen_dividend_stocks.py --fmp-api-key your_key_here
解决方案: 设置环境变量或通过命令行提供
export FINVIZ_API_KEY=your_key_here
# 或
python3 scripts/screen_dividend_stocks.py --use-finviz --finviz-api-key your_key_here
注意: 需要 FINVIZ Elite 订阅(约 40 美元/月或 330 美元/年)
可能原因:
解决方案:
可能原因:
解决方案:
检查互联网连接
验证 FINVIZ Elite 网站是否可访问
尝试仅使用 FMP 的方法作为备用:
python3 scripts/screen_dividend_stocks.py
解决方案: 脚本在 60 秒后自动重试。如果持续出现:
解决方案: 标准可能过于严格
预期行为: 脚本包含 0.3 秒的延迟以进行速率限制
两阶段筛选(FINVIZ + FMP):
仅使用 FMP 的筛选:
节省:FMP API 使用量减少 60-94%
FINVIZ Elite:
FMP API:
推荐:
每周安装次数
248
代码仓库
GitHub 星标数
398
首次出现
2026年1月26日
安全审计
安装于
gemini-cli237
opencode237
cursor235
codex235
github-copilot232
kimi-cli227
This skill identifies high-quality dividend stocks that combine value characteristics, attractive income generation, and consistent growth using a two-stage screening approach :
Screen US equities based on quantitative criteria including valuation ratios, dividend metrics, financial health, and profitability. Generate comprehensive reports ranking stocks by composite quality scores with detailed fundamental analysis.
Efficiency Advantage : Using FINVIZ pre-screening can reduce FMP API calls by 90%, making this approach ideal for free-tier API users.
Invoke this skill when the user requests:
For Two-Stage Screening (Recommended):
Check if both API keys are available:
import os
fmp_api_key = os.environ.get('FMP_API_KEY')
finviz_api_key = os.environ.get('FINVIZ_API_KEY')
If not available, ask user to provide API keys or set environment variables:
export FMP_API_KEY=your_fmp_key_here
export FINVIZ_API_KEY=your_finviz_key_here
For FMP-Only Screening:
Check if FMP API key is available:
import os
api_key = os.environ.get('FMP_API_KEY')
If not available, ask user to provide API key or set environment variable:
export FMP_API_KEY=your_key_here
FINVIZ Elite API Key:
Provide instructions from references/fmp_api_guide.md if needed.
Run the screening script with appropriate parameters:
Uses FINVIZ for pre-screening, then FMP for detailed analysis:
Default execution (Top 20 stocks):
python3 scripts/screen_dividend_stocks.py --use-finviz
With explicit API keys:
python3 scripts/screen_dividend_stocks.py --use-finviz \
--fmp-api-key $FMP_API_KEY \
--finviz-api-key $FINVIZ_API_KEY
Custom top N:
python3 scripts/screen_dividend_stocks.py --use-finviz --top 50
Custom output location:
python3 scripts/screen_dividend_stocks.py --use-finviz --output /path/to/results.json
Script behavior (Two-Stage):
Expected runtime (Two-Stage): 2-3 minutes for 30-50 FINVIZ candidates (much faster than FMP-only)
Uses only FMP Stock Screener API (higher API usage):
Default execution:
python3 scripts/screen_dividend_stocks.py
With explicit API key:
python3 scripts/screen_dividend_stocks.py --fmp-api-key $FMP_API_KEY
Script behavior (FMP-Only):
Expected runtime (FMP-Only): 5-15 minutes for 100-300 candidates (rate limiting applies)
API Usage Comparison:
Read the generated JSON file:
import json
with open('dividend_screener_results.json', 'r') as f:
data = json.load(f)
metadata = data['metadata']
stocks = data['stocks']
Key data points per stock:
symbol, company_name, sector, market_cap, pricedividend_yield, pe_ratio, pb_ratiodividend_cagr_3y, revenue_cagr_3y, eps_cagr_3yCreate structured markdown report for user with following sections:
# Value Dividend Stock Screening Report
**Generated:** [Timestamp]
**Screening Criteria:**
- Dividend Yield: >= 3.5%
- P/E Ratio: <= 20
- P/B Ratio: <= 2
- Dividend Growth (3Y CAGR): >= 5%
- Revenue Trend: Positive over 3 years
- EPS Trend: Positive over 3 years
**Total Results:** [N] stocks
---
## Top 20 Stocks Ranked by Composite Score
| Rank | Symbol | Company | Yield | P/E | Div Growth | Score |
|------|--------|---------|-------|-----|------------|-------|
| 1 | [TICKER] | [Name] | [%] | [X.X] | [%] | [XX.X] |
| ... |
---
## Detailed Analysis
### 1. [SYMBOL] - [Company Name] (Score: XX.X)
**Sector:** [Sector Name]
**Market Cap:** $[X.XX]B
**Current Price:** $[XX.XX]
**Valuation Metrics:**
- Dividend Yield: [X.X]%
- P/E Ratio: [XX.X]
- P/B Ratio: [X.X]
**Growth Profile (3-Year):**
- Dividend CAGR: [X.X]% [✓ Consistent / ⚠ One cut]
- Revenue CAGR: [X.X]%
- EPS CAGR: [X.X]%
**Dividend Sustainability:**
- Payout Ratio: [XX]%
- FCF Payout Ratio: [XX]%
- Status: [✓ Sustainable / ⚠ Monitor / ❌ Risk]
**Financial Health:**
- Debt-to-Equity: [X.XX]
- Current Ratio: [X.XX]
- Status: [✓ Healthy / ⚠ Caution]
**Quality Metrics:**
- ROE: [XX]%
- Net Profit Margin: [XX]%
- Quality Score: [XX]/100
**Investment Considerations:**
- [Key strength 1]
- [Key strength 2]
- [Risk factor or consideration]
---
[Repeat for other top stocks]
---
## Portfolio Construction Guidance
**Diversification Recommendations:**
- Sector breakdown of top 20 results
- Suggested allocation strategy
- Concentration risk warnings
**Monitoring Recommendations:**
- Key metrics to track quarterly
- Warning signs for each position
- Rebalancing triggers
**Risk Considerations:**
- Market cap concentration
- Sector biases in results
- Economic sensitivity warnings
Reference screening methodology when explaining results:
Key concepts to explain:
Load references/screening_methodology.md to provide detailed explanations of:
Anticipate common user questions:
"Why did [stock] not make the list?"
"Can I screen for specific sectors?"
"What if I want higher/lower yield threshold?"
"How often should I re-run this screen?"
"How many stocks should I buy?"
Comprehensive screening script that:
Dependencies: requests library (install via pip install requests)
Rate limiting: Built-in delays to respect FMP API limits (250 requests/day free tier)
Error handling: Graceful degradation for missing data, rate limit retries, API errors
Comprehensive documentation of screening approach:
Phase 1: Initial Quantitative Filters
Phase 2: Growth Quality Filters
Phase 3: Quality & Sustainability Analysis
Composite Scoring System (0-100 points)
Investment Philosophy
Usage Notes & Limitations
Complete guide for Financial Modeling Prep API:
API Key Setup
Key Endpoints Used
Rate Limiting Strategy
Error Handling
Data Quality Considerations
Modify thresholds in scripts/screen_dividend_stocks.py:
Line 383-388 - Initial screening parameters:
candidates = client.screen_stocks(
dividend_yield_min=3.5, # Adjust yield threshold
pe_max=20, # Adjust P/E threshold
pb_max=2, # Adjust P/B threshold
market_cap_min=2_000_000_000 # Minimum $2B market cap
)
Line 423 - Dividend CAGR threshold:
if not div_cagr or div_cagr < 5.0: # Adjust growth threshold
Add sector filtering after initial screening:
# Filter for specific sectors
target_sectors = ['Consumer Defensive', 'Utilities', 'Healthcare']
candidates = [s for s in candidates if s.get('sector') in target_sectors]
REITs and financial stocks have different dividend characteristics (higher payouts, different metrics):
# Exclude REITs and Financials
exclude_sectors = ['Real Estate', 'Financial Services']
candidates = [s for s in candidates if s.get('sector') not in exclude_sectors]
Convert JSON results to CSV for Excel analysis:
import json
import csv
with open('dividend_screener_results.json', 'r') as f:
data = json.load(f)
stocks = data['stocks']
with open('screening_results.csv', 'w', newline='') as csvfile:
if stocks:
fieldnames = stocks[0].keys()
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
writer.writeheader()
writer.writerows(stocks)
Solution: Install requests library
pip install requests
Solution: Set environment variable or provide via command-line
export FMP_API_KEY=your_key_here
# OR
python3 scripts/screen_dividend_stocks.py --fmp-api-key your_key_here
Solution: Set environment variable or provide via command-line
export FINVIZ_API_KEY=your_key_here
# OR
python3 scripts/screen_dividend_stocks.py --use-finviz --finviz-api-key your_key_here
Note: FINVIZ Elite subscription required (~$40/month or ~$330/year)
Possible causes:
Solution:
Possible causes:
Solution:
Check internet connection
Verify FINVIZ Elite website is accessible
Try FMP-only method as fallback:
python3 scripts/screen_dividend_stocks.py
Solution: Script automatically retries after 60 seconds. If persistent:
Solution: Criteria may be too restrictive
Expected behavior: Script includes 0.3s delay between API calls for rate limiting
Two-Stage Screening (FINVIZ + FMP):
FMP-Only Screening:
Savings: 60-94% reduction in FMP API usage
FINVIZ Elite:
FMP API:
Recommendation:
Weekly Installs
248
Repository
GitHub Stars
398
First Seen
Jan 26, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykFail
Installed on
gemini-cli237
opencode237
cursor235
codex235
github-copilot232
kimi-cli227
Python PDF处理教程:合并拆分、提取文本表格、创建PDF文件
55,400 周安装
payout_ratio, fcf_payout_ratio, dividend_sustainabledebt_to_equity, current_ratio, financially_healthyroe, profit_margin, quality_scorecomposite_score