重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
canslim-screener by nicepkg/ai-workflow
npx skills add https://github.com/nicepkg/ai-workflow --skill canslim-screener此技能使用威廉·欧奈尔经过验证的 CANSLIM 方法筛选美股,这是一种识别具有强劲基本面和价格动能的成长股的系统性方法。CANSLIM 分析 7 个关键组成部分:C 当前收益、A 年度增长、N 创新/新高、S 供需、L 领导力/相对强弱排名、I 机构赞助,以及 M 市场方向。
第二阶段 实现了 7 个组成部分中的 6 个(C、A、N、S、I、M),代表了 完整方法的 80%。此阶段在第一阶段的基础上增加了关键的成交量分析(S)和机构持股追踪(I)。
两阶段方法:
主要特性:
第二阶段组成部分权重(针对 6 个组成部分重新归一化):
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
显式触发:
隐式触发:
何时不使用:
检查用户是否已配置 FMP API 密钥:
# 检查环境变量
echo $FMP_API_KEY
# 如果未设置,提示用户提供
要求:
requests(FMP API 调用)beautifulsoup4(Finviz 网页抓取)lxml(HTML 解析)安装:
pip install requests beautifulsoup4 lxml
如果缺少 API 密钥,引导用户:
export FMP_API_KEY=your_key_here选项 A:默认股票池(推荐) 使用按市值排名前 40 的标普 500 股票(脚本中预定义):
python3 skills/canslim-screener/scripts/screen_canslim.py
选项 B:自定义股票池 用户提供特定代码或行业:
python3 skills/canslim-screener/scripts/screen_canslim.py \
--universe AAPL MSFT GOOGL AMZN NVDA META TSLA
选项 C:特定行业 用户可以提供专注于特定行业的列表(科技、医疗保健等)
API 预算考虑(第二阶段):
使用适当的参数运行主筛选脚本:
cd /Users/takueisaotome/PycharmProjects/claude-trading-skills/skills/canslim-screener/scripts
# 基本运行(40 只股票,报告中前 20 名)
python3 screen_canslim.py --api-key $FMP_API_KEY
# 自定义参数
python3 screen_canslim.py \
--api-key $FMP_API_KEY \
--max-candidates 40 \
--top 20 \
--output-dir ../../../
脚本工作流程(第二阶段):
预期执行时间(第二阶段):
Finviz 备用方案行为:
sharesOutstanding 不可用时自动触发✅ 对 NVDA 使用 Finviz 机构持股数据:68.3%脚本生成两个输出文件:
canslim_screener_YYYY-MM-DD_HHMMSS.json - 结构化数据canslim_screener_YYYY-MM-DD_HHMMSS.md - 人类可读报告阅读 Markdown 报告以识别顶级候选:
# 查找最新报告
ls -lt canslim_screener_*.md | head -1
# 阅读报告
cat canslim_screener_YYYY-MM-DD_HHMMSS.md
报告结构(第二阶段):
报告中新增组成部分详情:
审查排名靠前的股票,并与知识库交叉参考:
需查阅的参考文档:
references/interpretation_guide.md - 理解评级区间和投资组合规模references/canslim_methodology.md - 深入探讨组成部分含义(现已包含 S 和 I)references/scoring_system.md - 理解评分公式(第二阶段权重)分析框架:
对于 卓越+ 股票(90-100 分) :
对于 卓越股票(80-89 分) :
对于 强劲股票(70-79 分) :
对于 高于平均股票(60-69 分) :
熊市覆盖:
为用户创建简洁、可操作的摘要:
报告格式:
# CANSLIM 股票筛选结果(第二阶段)
**日期:** YYYY-MM-DD
**市场状况:** [趋势] - M 评分:[X]/100
**分析股票数:** [N]
**组成部分:** C, A, N, S, I, M (7 个中的 6 个)
## 市场摘要
[基于 M 组成部分的当前市场环境 2-3 句话]
[如果是熊市:警告 - 考虑增加现金配置]
## 前 5 名 CANSLIM 候选
### 1. [代码] - [公司名称] ⭐⭐⭐
**评分:** [X.X]/100 ([评级])
**价格:** $[XXX.XX] | **行业:** [行业]
**组成部分细分:**
- C(收益):[X]/100 - [每股收益增长]% 季度环比,[收入增长]% 收入
- A(增长):[X]/100 - [复合年增长率]% 3 年每股收益复合年增长率
- N(创新):[X]/100 - 距 52 周高点 [距离]%
- S(供需):[X]/100 - 上涨/下跌成交量比率:[X.XX]
- I(机构):[X]/100 - [N] 名持有人,[X.X]% 持股比例 [如果存在则显示 ⭐ 超级投资者]
- M(市场):[X]/100 - [趋势]
**解读:** [评级描述和指导]
**最弱组成部分:** [X] ([评分])
**数据来源说明:** [如果使用了 Finviz:"机构数据来自 Finviz"]
[重复前 5 只股票]
## 投资建议
**立即买入列表(90+ 评分):**
- [列出具有卓越+评级的股票]
- 头寸规模:每只 15-20%
**强烈买入列表(80-89 评分):**
- [列出具有卓越评级的股票]
- 头寸规模:每只 10-15%
**观察列表(70-79 评分):**
- [列出具有强劲评级的股票]
- 回调时买入
## 风险因素
- [识别来自组成部分的任何质量警告]
- [市场状况警告]
- [如果适用,行业集中风险]
- [如果大量使用 Finviz,数据来源可靠性说明]
## 后续步骤
1. 对前 3 名候选进行详细的基本面分析
2. 检查即将发布的收益日历
3. 审查技术图表以确定入场时机
4. [如果是熊市:在部署资金前等待市场复苏]
---
**注意:** 这是第二阶段(C, A, N, S, I, M 组成部分 - 80% 覆盖)。第三阶段将添加 L 组成部分以实现完整的 7 组成部分 CANSLIM。
scripts/)主要脚本:
screen_canslim.py - 主编排脚本
python3 screen_canslim.py --api-key KEY [选项]fmp_client.py - FMP API 客户端包装器
get_income_statement()、get_quote()、get_historical_prices()、get_institutional_holders()finviz_stock_client.py - Finviz 网页抓取客户端 ← 新增
get_institutional_ownership()、get_stock_data()计算器 (scripts/calculators/):
earnings_calculator.py - C 组成部分(当前收益)
growth_calculator.py - A 组成部分(年度增长)
new_highs_calculator.py - N 组成部分(创新)
supply_demand_calculator.py - S 组成部分(供需)← 新增
institutional_calculator.py - I 组成部分(机构)← 新增
market_calculator.py - M 组成部分(市场方向)
支持模块:
scorer.py - 综合评分计算
report_generator.py - 输出生成
references/)知识库:
canslim_methodology.md (27KB) - 完整的 CANSLIM 解释 ← 已更新至第二阶段
scoring_system.md (21KB) - 技术评分规范 ← 已更新至第二阶段
fmp_api_endpoints.md (18KB) - API 集成指南 ← 已更新至第二阶段
interpretation_guide.md (18KB) - 用户指导
如何使用参考文档:
canslim_methodology.md 以理解欧奈尔的系统(现已包含 S 和 I)interpretation_guide.mdscoring_system.mdfmp_api_endpoints.md 以进行 API 故障排除或 Finviz 备用方案问题症状:
ERROR: 429 Too Many Requests - Rate limit exceeded
Retrying in 60 seconds...
原因:
解决方案:
--max-candidates 30 以降低 API 使用量症状:
ERROR: required libraries not found. Install with: pip install beautifulsoup4 requests lxml
解决方案:
# 安装所有所需库
pip install requests beautifulsoup4 lxml
# 或单独安装
pip install beautifulsoup4
pip install requests
pip install lxml
症状:
Execution time: 2 minutes 30 seconds for 40 stocks (slower than expected)
原因:
解决方案:
finviz_stock_client.py,将 rate_limit_seconds=2.0 更改为 1.5(风险:IP 封禁)注意: Finviz 备用方案每只股票增加约 2 秒,但显著提高了 I 组成部分的准确度(35 → 60-100 分)。
症状:
WARNING: Finviz request failed with status 403 for NVDA
⚠️ Using Finviz institutional ownership data - FMP shares outstanding unavailable. Finviz fallback also unavailable. Score reduced by 50%.
原因:
解决方案:
优雅降级:
症状:
✓ Successfully analyzed 40 stocks
Top 5 Stocks:
1. AAPL - 58.3 (Average)
2. MSFT - 55.1 (Average)
...
原因:
解决方案:
症状:
⚠️ Revenue declining despite EPS growth (possible buyback distortion)
⚠️ Using Finviz institutional ownership data (68.3%) - FMP shares outstanding unavailable.
解读:
操作:
这是 第二阶段,实现了 7 个 CANSLIM 组成部分中的 6 个:
影响:
评分转换:
自动备用系统:
sharesOutstanding 时,Finviz 自动激活数据源优先级:
测试可靠性:
第三阶段(计划中):
第四阶段(计划中):
此筛选器仅用于教育和信息目的。
版本: 第二阶段 最后更新: 2026-01-12 API 要求: FMP API(免费层级足够)+ BeautifulSoup/requests/lxml 用于 Finviz 执行时间: 40 只股票约 1 分 40 秒 输出格式: JSON + Markdown 已实现的组成部分: C, A, N, S, I, M (7 个中的 6 个,80% 覆盖)
每周安装
51
仓库
GitHub 星标
142
首次出现
2026 年 1 月 24 日
安全审计
安装于
opencode37
claude-code32
cursor32
gemini-cli31
codex30
github-copilot24
This skill screens US stocks using William O'Neil's proven CANSLIM methodology, a systematic approach for identifying growth stocks with strong fundamentals and price momentum. CANSLIM analyzes 7 key components: C urrent Earnings, A nnual Growth, N ewness/New Highs, S upply/Demand, L eadership/RS Rank, I nstitutional Sponsorship, and M arket Direction.
Phase 2 implements 6 of 7 components (C, A, N, S, I, M), representing 80% of the full methodology. This phase adds critical volume analysis (S) and institutional ownership tracking (I) to the Phase 1 foundation.
Two-Stage Approach:
Key Features:
Phase 2 Component Weights (Renormalized for 6 components):
Future Phases:
Explicit Triggers:
Implicit Triggers:
When NOT to Use:
Check if user has FMP API key configured:
# Check environment variable
echo $FMP_API_KEY
# If not set, prompt user to provide it
Requirements:
requests (FMP API calls)beautifulsoup4 (Finviz web scraping)lxml (HTML parsing)Installation:
pip install requests beautifulsoup4 lxml
If API key is missing, guide user to:
export FMP_API_KEY=your_key_hereOption A: Default Universe (Recommended) Use top 40 S&P 500 stocks by market cap (predefined in script):
python3 skills/canslim-screener/scripts/screen_canslim.py
Option B: Custom Universe User provides specific symbols or sector:
python3 skills/canslim-screener/scripts/screen_canslim.py \
--universe AAPL MSFT GOOGL AMZN NVDA META TSLA
Option C: Sector-Specific User can provide sector-focused list (Technology, Healthcare, etc.)
API Budget Considerations (Phase 2):
Run the main screening script with appropriate parameters:
cd /Users/takueisaotome/PycharmProjects/claude-trading-skills/skills/canslim-screener/scripts
# Basic run (40 stocks, top 20 in report)
python3 screen_canslim.py --api-key $FMP_API_KEY
# Custom parameters
python3 screen_canslim.py \
--api-key $FMP_API_KEY \
--max-candidates 40 \
--top 20 \
--output-dir ../../../
Script Workflow (Phase 2):
Expected Execution Time (Phase 2):
Finviz Fallback Behavior:
sharesOutstanding unavailable✅ Using Finviz institutional ownership for NVDA: 68.3%The script generates two output files:
canslim_screener_YYYY-MM-DD_HHMMSS.json - Structured datacanslim_screener_YYYY-MM-DD_HHMMSS.md - Human-readable reportRead the Markdown report to identify top candidates:
# Find the latest report
ls -lt canslim_screener_*.md | head -1
# Read the report
cat canslim_screener_YYYY-MM-DD_HHMMSS.md
Report Structure (Phase 2):
New Component Details in Report:
Review the top-ranked stocks and cross-reference with knowledge bases:
Reference Documents to Consult:
references/interpretation_guide.md - Understand rating bands and portfolio sizingreferences/canslim_methodology.md - Deep dive into component meanings (now includes S and I)references/scoring_system.md - Understand scoring formulas (Phase 2 weights)Analysis Framework:
For Exceptional+ stocks (90-100 points) :
For Exceptional stocks (80-89 points) :
For Strong stocks (70-79 points) :
For Above Average stocks (60-69 points) :
Bear Market Override:
Create a concise, actionable summary for the user:
Report Format:
# CANSLIM Stock Screening Results (Phase 2)
**Date:** YYYY-MM-DD
**Market Condition:** [Trend] - M Score: [X]/100
**Stocks Analyzed:** [N]
**Components:** C, A, N, S, I, M (6 of 7)
## Market Summary
[2-3 sentences on current market environment based on M component]
[If bear market: WARNING - Consider raising cash allocation]
## Top 5 CANSLIM Candidates
### 1. [SYMBOL] - [Company Name] ⭐⭐⭐
**Score:** [X.X]/100 ([Rating])
**Price:** $[XXX.XX] | **Sector:** [Sector]
**Component Breakdown:**
- C (Earnings): [X]/100 - [EPS growth]% QoQ, [Revenue growth]% revenue
- A (Growth): [X]/100 - [CAGR]% 3yr EPS CAGR
- N (Newness): [X]/100 - [Distance]% from 52wk high
- S (Supply/Demand): [X]/100 - Up/Down Volume Ratio: [X.XX]
- I (Institutional): [X]/100 - [N] holders, [X.X]% ownership [⭐ Superinvestor if present]
- M (Market): [X]/100 - [Trend]
**Interpretation:** [Rating description and guidance]
**Weakest Component:** [X] ([score])
**Data Source Note:** [If Finviz used: "Institutional data from Finviz"]
[Repeat for top 5 stocks]
## Investment Recommendations
**Immediate Buy List (90+ score):**
- [List stocks with exceptional+ ratings]
- Position sizing: 15-20% each
**Strong Buy List (80-89 score):**
- [List stocks with exceptional ratings]
- Position sizing: 10-15% each
**Watchlist (70-79 score):**
- [List stocks with strong ratings]
- Buy on pullback
## Risk Factors
- [Identify any quality warnings from components]
- [Market condition warnings]
- [Sector concentration risks if applicable]
- [Data source reliability notes if Finviz heavily used]
## Next Steps
1. Conduct detailed fundamental analysis on top 3 candidates
2. Check earnings calendars for upcoming reports
3. Review technical charts for entry timing
4. [If bear market: Wait for market recovery before deploying capital]
---
**Note:** This is Phase 2 (C, A, N, S, I, M components - 80% coverage). Phase 3 will add L component for full 7-component CANSLIM.
scripts/)Main Scripts:
screen_canslim.py - Main orchestrator script
python3 screen_canslim.py --api-key KEY [options]fmp_client.py - FMP API client wrapper
get_income_statement(), get_quote(), get_historical_prices(), get_institutional_holders()finviz_stock_client.py - Finviz web scraping client ←
Calculators (scripts/calculators/):
earnings_calculator.py - C component (Current Earnings)
growth_calculator.py - A component (Annual Growth)
new_highs_calculator.py - N component (Newness)
supply_demand_calculator.py - S component (Supply/Demand) ← NEW
institutional_calculator.py - I component (Institutional) ←
Supporting Modules:
scorer.py - Composite score calculation
report_generator.py - Output generation
references/)Knowledge Bases:
canslim_methodology.md (27KB) - Complete CANSLIM explanation ← Updated for Phase 2
scoring_system.md (21KB) - Technical scoring specification ← Updated for Phase 2
fmp_api_endpoints.md (18KB) - API integration guide ← Updated for Phase 2
How to Use References:
canslim_methodology.md first to understand O'Neil's system (now includes S and I)interpretation_guide.md when analyzing resultsscoring_system.md if scores seem unexpectedfmp_api_endpoints.md for API troubleshooting or Finviz fallback issuesSymptoms:
ERROR: 429 Too Many Requests - Rate limit exceeded
Retrying in 60 seconds...
Causes:
Solutions:
--max-candidates 30 to lower API usageSymptoms:
ERROR: required libraries not found. Install with: pip install beautifulsoup4 requests lxml
Solutions:
# Install all required libraries
pip install requests beautifulsoup4 lxml
# Or install individually
pip install beautifulsoup4
pip install requests
pip install lxml
Symptoms:
Execution time: 2 minutes 30 seconds for 40 stocks (slower than expected)
Causes:
Solutions:
finviz_stock_client.py, change rate_limit_seconds=2.0 to 1.5 (risk: IP ban)Note: Finviz fallback adds ~2 seconds per stock but significantly improves I component accuracy (35 → 60-100 points).
Symptoms:
WARNING: Finviz request failed with status 403 for NVDA
⚠️ Using Finviz institutional ownership data - FMP shares outstanding unavailable. Finviz fallback also unavailable. Score reduced by 50%.
Causes:
Solutions:
Graceful Degradation:
Symptoms:
✓ Successfully analyzed 40 stocks
Top 5 Stocks:
1. AAPL - 58.3 (Average)
2. MSFT - 55.1 (Average)
...
Causes:
Solutions:
Symptoms:
⚠️ Revenue declining despite EPS growth (possible buyback distortion)
⚠️ Using Finviz institutional ownership data (68.3%) - FMP shares outstanding unavailable.
Interpretation:
Actions:
This is Phase 2 implementing 6 of 7 CANSLIM components:
Implications:
Score Conversion:
Automatic Fallback System:
sharesOutstanding, Finviz automatically activatesData Source Priority:
Tested Reliability:
Phase 3 (Planned):
Phase 4 (Planned):
This screener is for educational and informational purposes only.
Version: Phase 2 Last Updated: 2026-01-12 API Requirements: FMP API (free tier sufficient) + BeautifulSoup/requests/lxml for Finviz Execution Time: ~1 minute 40 seconds for 40 stocks Output Formats: JSON + Markdown Components Implemented: C, A, N, S, I, M (6 of 7, 80% coverage)
Weekly Installs
51
Repository
GitHub Stars
142
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
opencode37
claude-code32
cursor32
gemini-cli31
codex30
github-copilot24
Python PDF处理教程:合并拆分、提取文本表格、创建PDF文件
68,800 周安装
get_institutional_ownership(), get_stock_data()market_calculator.py - M component (Market Direction)
interpretation_guide.md (18KB) - User guidance