
Fund Screener
- 276 installs
- 6 repo stars
- Updated February 25, 2026
- sososun/mutual-fund-skills
Helps with ai & agent building tasks.
About
fund-screener is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.
- fund-screener
- AI & Agent Building
- AI-coding skill
Fund Screener by the numbers
- 276 all-time installs (skills.sh)
- +9 installs in the week ending Aug 5, 2026 (Skillselion tracking)
- Ranked #2,429 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/sososun/mutual-fund-skills --skill fund-screenerAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 276 |
|---|---|
| repo stars | ★ 6 |
| Last updated | February 25, 2026 |
| Repository | sososun/mutual-fund-skills ↗ |
What it does
Helps with ai & agent building tasks.
Files
基金分析技能 (Fund Screener)
通过 AkShare 获取中国公募基金实时数据,基于量化指标筛选优质基金产品。
功能
1. 单基金深度分析: 对单只基金进行全方位诊断,包括风险指标、阶段收益、年度收益、资产配置、基金经理、持仓信息 2. 全市场批量筛选: 从全市场开放式基金中智能筛选,支持多种模式 3. 结果导出: 自动保存 CSV 文件
使用方法
运行此技能需要 Python 3.8+ 和依赖: pip install akshare pandas numpy
# 单基金分析
python fund_screener.py <基金代码> [基金名称]
# 纯债基金筛选(低风险)
python fund_screener.py --bond
# 固收+基金筛选
python fund_screener.py --gushou-plus
# 股票类基金筛选
python fund_screener.py --stock
# Alpha策略筛选(卡玛比率)
python fund_screener.py --stock-alpha
# 自定义参数
python fund_screener.py --bond --min-sharpe 1.0 --max-dd 2 --min-return 2.5
python fund_screener.py --gushou-plus --min-sortino 1.5
python fund_screener.py --stock-alpha --min-calmar 0.8 --min-return 10
# 数量控制
python fund_screener.py --bond --max 50筛选模式与指标
| 模式 | 参数 | 核心指标 | 默认筛选标准 |
|---|---|---|---|
| 纯债基金 | --bond | 夏普比率 | 夏普>=1.0, 回撤<2%, 收益>2.5% |
| 固收+ | --gushou-plus | 索提诺比率 | 夏普>=0.8, 索提诺>=1.2, 回撤<5%, 收益>3.5% |
| 股票Alpha | --stock-alpha | 卡玛比率 | 卡玛>=1.2, 回撤<30%, 收益>10% |
| 默认/股票 | 无/--stock | 夏普比率 | 夏普>=0.5, 回撤<15%, 收益>3% |
自定义参数
| 参数 | 说明 |
|---|---|
--min-sharpe <value> | 最小夏普比率 |
--min-sortino <value> | 最小索提诺比率 |
--min-calmar <value> | 最小卡玛比率 |
--max-dd <value> | 最大回撤百分比(正数,如5表示<5%) |
--min-return <value> | 最小年化收益率(%) |
--max <value> | 最大分析数量(50-500) |
作为 Python 模块使用
from fund_screener import get_fund_metrics, analyze_single_fund, calculate_sharpe_ratio
# 分析单只基金
metrics = get_fund_metrics('004010', '华泰柏瑞鼎利混合A')
# 深度分析
analysis = analyze_single_fund('004010')数据来源
- 基金净值: 东方财富网 (via AkShare)
- 基金经理/规模: 基金经理持仓数据
- 资产配置: 基金季度持仓报告
- 数据验证: 百度股市通 (via BrowserMCP,可选增强)
浏览器数据验证(BrowserMCP)
AkShare的部分数据存在已知偏差(基金规模为经理总规模而非单只基金规模、持仓数据可能滞后、收益率计算口径差异)。当BrowserMCP可用时,应在Python筛选生成CSV后,自动通过浏览器访问百度股市通进行数据交叉验证和修正。
前置条件
.mcp.json中已配置 BrowserMCP
完整工作流
Step 1: 运行Python筛选 → 生成初始CSV
Step 2: 读取CSV,识别A/C份额对,去重
Step 3: 逐只基金通过BrowserMCP访问百度股市通
Step 4: 验证并修正三大数据:规模、持仓、收益
Step 5: 更新CSV + 保存验证缓存JSON
Step 6: 输出修正摘要Step 2: A/C份额去重
同一基金的A/C份额共享相同的持仓和规模,无需重复验证。去重规则:
- 去掉基金名称末尾的A/B/C/E/H后缀进行分组
- 每组只验证一个份额(代码数字较小的优先)
- 验证后的持仓和规模数据复制到同组所有份额
- 近1年收益因费率差异不同,每个份额单独取值(或仅验证A份额)
Step 3: 浏览器验证协议
对每只唯一基金,访问两个页面:
3a. 持仓页 — 获取前5大持仓
URL: https://gushitong.baidu.com/fund/ab-{code}?mainTab=%E6%8C%81%E4%BB%93
使用 browser_navigate 访问后 browser_snapshot 获取快照。在快照文本中查找:
十大重仓股票 更新日期:YYYY-MM-DD
股票A名 X.XX% 股票B名 X.XX% 股票C名 X.XX% ...提取前5个股票名称,用 , 连接作为"前5大持仓"。
异常处理:
- 若显示
十大重仓股票 暂无数据→ 保留CSV原值(港股通基金常见) - 若页面超时 → 重试1次,仍失败则跳过
- 若显示
服务异常→ 等待2秒后重试
3b. 简况页 — 获取规模和近1年收益
URL: https://gushitong.baidu.com/fund/ab-{code}?mainTab=%E7%AE%80%E5%86%B5
使用 browser_navigate 访问后 browser_snapshot 获取快照。在快照文本中查找:
- 近1年收益: 寻找
近一年附近的百分比数值,如+53.47% 近一年→ 提取53.47 - 基金规模: 寻找
规模附近的数值,格式如X.XX亿→ 提取X.XX
注意:部分基金的规模在简况页未直接显示数值,可尝试从持仓页的快照中查找。
Step 4: 修正CSV
对每只验证过的基金:
- 若百度的"前5大持仓"与CSV不同 → 用百度数据覆盖CSV
- 若百度的"基金规模"与CSV不同 → 用百度数据覆盖CSV
- 若百度的"近1年收益"与CSV不同 → 用百度数据覆盖CSV
- 对A/C份额对:将A份额的持仓和规模数据同步到C份额
Step 5: 保存验证缓存
更新 baidu_fund_data.json 文件,Schema如下:
{
"004814": {
"规模": "189.25",
"近1年": "53.63",
"前5大持仓": "紫金矿业, 徐工机械, 新华保险, 中国重汽, 三一重工",
"持仓更新日期": "2025-12-31",
"验证时间": "2026-02-24"
}
}Step 6: 输出修正摘要
验证完成后打印汇总表:
=== 数据验证摘要 ===
总计检查: 25 只(去重后)
规模修正: 18 只
持仓修正: 14 只
收益修正: 4 只
跳过(暂无数据): 2 只性能优化
- 每次页面加载后等待1-2秒,避免触发反爬
- 25只唯一基金约需50次页面加载,预计耗时5-8分钟
- 可利用缓存JSON:若当天已验证过,跳过重复验证
风险提示
历史业绩不代表未来表现。本工具仅供学习研究,不构成投资建议。
"""
基金分析技能 (Mutual Fund Skills)
基于 Python + AkShare 的全市场基金分析工具
"""
from .fund_screener import (
calculate_sharpe_ratio,
calculate_max_drawdown,
calculate_annualized_return,
calculate_calmar_ratio,
calculate_sortino_ratio,
calculate_information_ratio,
get_fund_metrics,
get_fund_scale,
get_fund_asset_allocation,
get_fund_manager_info,
analyze_funds,
analyze_single_fund,
analyze_gushou_plus_funds_advanced,
analyze_stock_funds_advanced,
filter_quality_funds,
filter_quality_stock_funds,
filter_quality_gushou_plus_funds,
get_default_fund_pool,
main
)
__version__ = '1.3.0'
__all__ = [
'calculate_sharpe_ratio',
'calculate_max_drawdown',
'calculate_annualized_return',
'calculate_calmar_ratio',
'calculate_sortino_ratio',
'calculate_information_ratio',
'get_fund_metrics',
'get_fund_scale',
'get_fund_asset_allocation',
'get_fund_manager_info',
'analyze_funds',
'analyze_single_fund',
'analyze_gushou_plus_funds_advanced',
'analyze_stock_funds_advanced',
'filter_quality_funds',
'filter_quality_stock_funds',
'filter_quality_gushou_plus_funds',
'get_default_fund_pool',
'main'
]
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
*.egg-info/
dist/
build/
*.egg
# Virtual environments
venv/
env/
ENV/
# IDE
.vscode/
.idea/
*.swp
*.swo
*~
# OS
.DS_Store
Thumbs.db
# Output files
*.csv
*.xlsx
*.json
# Logs
*.log
# Node
node_modules/
#!/usr/bin/env node
/**
* 基金分析技能 CLI
* 通过 npx mutual-fund-skills 直接运行
*/
const { spawn } = require('child_process');
const path = require('path');
const fs = require('fs');
// 颜色输出
const colors = {
reset: '\x1b[0m',
bright: '\x1b[1m',
red: '\x1b[31m',
green: '\x1b[32m',
yellow: '\x1b[33m',
blue: '\x1b[34m',
cyan: '\x1b[36m'
};
function printBanner() {
console.log(`${colors.cyan}
╔══════════════════════════════════════════════════════════════════╗
║ ║
║ 基金分析技能 (Mutual Fund Skills) v1.3.0 ║
║ ║
║ 基于 AkShare 的高夏普比率、低回撤基金筛选工具 ║
║ ║
╚══════════════════════════════════════════════════════════════════╝${colors.reset}\n`);
}
function checkPython() {
return new Promise((resolve, reject) => {
const python = spawn('python3', ['--version']);
let version = '';
python.stdout.on('data', (data) => {
version += data.toString();
});
python.on('close', (code) => {
if (code === 0) {
resolve(version.trim());
} else {
// 尝试 python
const python2 = spawn('python', ['--version']);
python2.on('close', (code2) => {
if (code2 === 0) {
resolve('python');
} else {
reject(new Error('未找到 Python,请先安装 Python 3.8+'));
}
});
}
});
});
}
async function main() {
printBanner();
try {
// 检查 Python
const pythonVersion = await checkPython();
console.log(`${colors.green}✓ 检测到 ${pythonVersion}${colors.reset}\n`);
// 获取脚本路径
const scriptPath = path.join(__dirname, 'fund_screener.py');
if (!fs.existsSync(scriptPath)) {
console.error(`${colors.red}✗ 错误: 找不到 fund_screener.py${colors.reset}`);
process.exit(1);
}
// 运行 Python 脚本
console.log(`${colors.yellow}正在启动基金筛选器...${colors.reset}\n`);
const pythonCmd = pythonVersion === 'python' ? 'python' : 'python3';
const child = spawn(pythonCmd, [scriptPath], {
stdio: 'inherit',
cwd: __dirname
});
child.on('close', (code) => {
if (code !== 0) {
console.error(`${colors.red}\n✗ 程序异常退出 (code: ${code})${colors.reset}`);
process.exit(code);
}
});
} catch (error) {
console.error(`${colors.red}✗ 错误: ${error.message}${colors.reset}`);
console.log(`\n${colors.yellow}请先安装 Python 3.8+:${colors.reset}`);
console.log(' macOS: brew install python');
console.log(' Linux: sudo apt-get install python3');
console.log(' Windows: https://python.org/downloads\n');
process.exit(1);
}
}
// 处理命令行参数
const args = process.argv.slice(2);
if (args.includes('--help') || args.includes('-h')) {
console.log(`${colors.cyan}
基金分析技能 - 使用方法
命令:
# 基金类型筛选
npx mutual-fund-skills --bond 纯债基金筛选(低风险)
npx mutual-fund-skills --gushou-plus 固收+专业筛选(铁三角)
npx mutual-fund-skills --stock 股票类基金筛选
npx mutual-fund-skills --stock-alpha 专业Alpha策略筛选
# 自定义筛选参数
npx mutual-fund-skills --bond --min-sharpe 1.0 --max-dd 2
npx mutual-fund-skills --gushou-plus --min-sortino 1.5
npx mutual-fund-skills --stock-alpha --min-calmar 0.8 --min-return 10
# 数量控制
npx mutual-fund-skills --bond --max 50 筛选50只
npx mutual-fund-skills <基金代码> 分析单个基金
# 帮助
npx mutual-fund-skills --help 显示帮助信息
npx mutual-fund-skills --version 显示版本
筛选模式说明:
• --bond / --pure-bond: 纯债基金筛选(夏普>1.0 & 回撤<2%)
• --gushou-plus: 固收+基金筛选(夏普>0.8 & 索提诺>1.2 & 回撤<5%)
• --stock: 股票类基金筛选(普通模式)
• --stock-alpha: Alpha策略筛选(卡玛>1.2 & 收益>10%)
自定义参数:
• --min-sharpe <value>: 最小夏普比率
• --max-dd <value>: 最大回撤百分比(正数,如5表示回撤<5%)
• --min-return <value>: 最小年化收益率
• --min-calmar <value>: 最小卡玛比率
• --min-sortino <value>: 最小索提诺比率
• --max <value>: 最大分析数量(50-500)
示例:
# 纯债基金筛选
npx mutual-fund-skills --bond
# 纯债基金,自定义标准
npx mutual-fund-skills --bond --min-sharpe 1.0 --max-dd 2 --min-return 2.5
# 固收+基金筛选
npx mutual-fund-skills --gushou-plus
# 股票型Alpha筛选
npx mutual-fund-skills --stock-alpha
专业指标说明:
• 夏普比率 (Sharpe): 风险调整收益,>0.5良好,>1.0优秀
• 索提诺比率 (Sortino): 只惩罚下行波动,>1.2良好,>2.0优秀(固收+核心)
• 卡玛比率 (Calmar): 收益/回撤,>0.8良好,>1.2优秀(股票核心)
• 最大回撤: 历史上最大亏损,越小越好
依赖:
• Python 3.8+
• akshare, pandas, numpy
安装依赖:
pip install akshare pandas numpy
${colors.reset}`);
process.exit(0);
}
if (args.includes('--version') || args.includes('-v')) {
console.log('v1.3.0');
process.exit(0);
}
// 检查是否是单个基金分析模式
if (args.length > 0 && !args[0].startsWith('--')) {
// 单个基金分析模式
const fundCode = args[0];
const fundName = args[1] || null;
printBanner();
checkPython().then((pythonVersion) => {
console.log(`${colors.green}✓ 检测到 ${pythonVersion}${colors.reset}\n`);
const scriptPath = path.join(__dirname, 'fund_screener.py');
if (!fs.existsSync(scriptPath)) {
console.error(`${colors.red}✗ 错误: 找不到 fund_screener.py${colors.reset}`);
process.exit(1);
}
console.log(`${colors.yellow}正在分析基金: ${fundCode}${colors.reset}\n`);
const pythonCmd = pythonVersion === 'python' ? 'python' : 'python3';
const pythonArgs = [scriptPath, fundCode];
if (fundName) {
pythonArgs.push(fundName);
}
const child = spawn(pythonCmd, pythonArgs, {
stdio: 'inherit',
cwd: __dirname
});
child.on('close', (code) => {
if (code !== 0) {
console.error(`${colors.red}\n✗ 程序异常退出 (code: ${code})${colors.reset}`);
process.exit(code);
}
});
}).catch((error) => {
console.error(`${colors.red}✗ 错误: ${error.message}${colors.reset}`);
console.log(`\n${colors.yellow}请先安装 Python 3.8+:${colors.reset}`);
console.log(' macOS: brew install python');
console.log(' Linux: sudo apt-get install python3');
console.log(' Windows: https://python.org/downloads\n');
process.exit(1);
});
} else {
// 批量筛选模式 - 默认全市场筛选
printBanner();
checkPython().then((pythonVersion) => {
console.log(`${colors.green}✓ 检测到 ${pythonVersion}${colors.reset}\n`);
const scriptPath = path.join(__dirname, 'fund_screener.py');
// 构建参数 - 透传所有支持的参数给 Python
const pythonArgs = [scriptPath];
// 透传带值的参数
const valueArgs = ['--max', '--min-sharpe', '--max-dd', '--min-return', '--min-calmar', '--min-sortino'];
for (const argName of valueArgs) {
if (args.includes(argName)) {
const idx = args.indexOf(argName);
if (idx + 1 < args.length) {
pythonArgs.push(argName, args[idx + 1]);
}
}
}
// 透传开关参数
const flagArgs = ['--gushou-plus', '--stock', '--stock-alpha', '--smart-pick', '--dividend', '--bond', '--pure-bond'];
for (const flag of flagArgs) {
if (args.includes(flag)) {
pythonArgs.push(flag);
}
}
// 显示模式提示
if (args.includes('--bond') || args.includes('--pure-bond')) {
console.log(`${colors.yellow}启动纯债基金筛选...${colors.reset}\n`);
} else if (args.includes('--gushou-plus')) {
console.log(`${colors.yellow}启动固收+基金专业筛选...${colors.reset}\n`);
} else if (args.includes('--dividend')) {
console.log(`${colors.yellow}启动红利/高股息基金筛选...${colors.reset}\n`);
} else if (args.includes('--smart-pick')) {
console.log(`${colors.yellow}启动智选主动基金筛选(哑铃结构)...${colors.reset}\n`);
} else if (args.includes('--stock-alpha')) {
console.log(`${colors.yellow}启动专业Alpha策略筛选...${colors.reset}\n`);
} else if (args.includes('--stock')) {
console.log(`${colors.yellow}启动股票类基金智能筛选...${colors.reset}\n`);
} else {
console.log(`${colors.yellow}启动全市场基金智能筛选...${colors.reset}\n`);
}
const pythonCmd = pythonVersion === 'python' ? 'python' : 'python3';
const child = spawn(pythonCmd, pythonArgs, {
stdio: 'inherit',
cwd: __dirname
});
child.on('close', (code) => {
if (code !== 0) {
console.error(`${colors.red}\n✗ 程序异常退出 (code: ${code})${colors.reset}`);
process.exit(code);
}
});
}).catch((error) => {
console.error(`${colors.red}✗ 错误: ${error.message}${colors.reset}`);
console.log(`\n${colors.yellow}请先安装 Python 3.8+:${colors.reset}`);
console.log(' macOS: brew install python');
console.log(' Linux: sudo apt-get install python3');
console.log(' Windows: https://python.org/downloads\n');
process.exit(1);
});
}
#!/usr/bin/env python3
"""
基金分析技能 使用示例
展示如何调用各个功能函数
"""
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from fund_screener import (
get_fund_metrics,
get_fund_asset_allocation,
get_fund_scale,
analyze_funds,
filter_quality_funds,
get_default_fund_pool
)
# 示例1: 分析单只基金
print("=" * 80)
print("示例1: 分析单只基金")
print("=" * 80)
fund_code = '004010'
fund_name = '华泰柏瑞鼎利混合A'
print(f"\n分析基金: {fund_code} {fund_name}")
metrics = get_fund_metrics(fund_code, fund_name)
if metrics:
print("\n风险指标:")
print(f" 夏普比率: {metrics['夏普比率']}")
print(f" 最大回撤: {metrics['最大回撤(%)']}%")
print(f" 年化收益: {metrics['年化收益率(%)']}%")
print(f" 波动率: {metrics['年化波动率(%)']}%")
print(f" 近1年收益: {metrics['近1年收益(%)']}%")
else:
print(" 获取数据失败")
# 示例2: 获取资产配置
print("\n" + "=" * 80)
print("示例2: 获取资产配置")
print("=" * 80)
allocation = get_fund_asset_allocation(fund_code)
print(f"\n{fund_name} 资产配置:")
for key, value in allocation.items():
print(f" {key}: {value}")
# 示例3: 自定义基金池分析
print("\n" + "=" * 80)
print("示例3: 自定义基金池分析")
print("=" * 80)
# 定义要分析的基金列表
custom_funds = [
('002015', '南方荣光A', '偏债混合'),
('001316', '安信稳健增值混合A', '偏债混合'),
('000385', '景顺长城景颐双利债券A', '二级债基'),
]
print(f"\n分析 {len(custom_funds)} 只基金...")
results_df = analyze_funds(custom_funds, delay=0.5)
if len(results_df) > 0:
print("\n结果:")
print(results_df[['基金代码', '基金名称', '夏普比率', '最大回撤(%)', '年化收益率(%)']].to_string(index=False))
# 示例4: 筛选优质基金
print("\n" + "=" * 80)
print("示例4: 筛选优质基金")
print("=" * 80)
if len(results_df) > 0:
# 筛选夏普>0.5且回撤>-15%的基金
quality_funds = filter_quality_funds(
results_df,
min_sharpe=0.5,
max_drawdown=-15
)
print(f"\n筛选条件: 夏普>=0.5, 回撤>-15%")
print(f"找到 {len(quality_funds)} 只优质基金:")
if len(quality_funds) > 0:
print(quality_funds[['基金代码', '基金名称', '夏普比率', '最大回撤(%)']].to_string(index=False))
# 示例5: 使用默认基金池
print("\n" + "=" * 80)
print("示例5: 获取默认基金池")
print("=" * 80)
default_pool = get_default_fund_pool()
print(f"\n默认基金池包含 {len(default_pool)} 只基金")
print("\n前10只基金:")
for code, name, ftype in default_pool[:10]:
print(f" {code} {name} ({ftype})")
print("\n" + "=" * 80)
print("示例运行完成!")
print("=" * 80)
#!/usr/bin/env node
/**
* 安装后脚本 - 检查 Python 依赖
*/
const { spawn } = require('child_process');
const colors = {
reset: '\x1b[0m',
green: '\x1b[32m',
yellow: '\x1b[33m',
red: '\x1b[31m',
cyan: '\x1b[36m'
};
console.log(`${colors.cyan}\n🚀 基金分析技能安装完成!${colors.reset}\n`);
// 检查 Python 依赖
console.log(`${colors.yellow}检查 Python 依赖...${colors.reset}`);
const checkDep = (dep) => {
return new Promise((resolve) => {
const python = spawn('python3', ['-c', `import ${dep}`]);
python.on('close', (code) => resolve(code === 0));
});
};
(async () => {
const deps = ['akshare', 'pandas', 'numpy'];
const missing = [];
for (const dep of deps) {
const hasDep = await checkDep(dep);
if (hasDep) {
console.log(` ${colors.green}✓${colors.reset} ${dep}`);
} else {
console.log(` ${colors.red}✗${colors.reset} ${dep}`);
missing.push(dep);
}
}
if (missing.length > 0) {
console.log(`\n${colors.yellow}缺少以下 Python 依赖,请运行:${colors.reset}`);
console.log(`${colors.cyan} pip install ${missing.join(' ')}${colors.reset}\n`);
} else {
console.log(`\n${colors.green}✓ 所有依赖已安装${colors.reset}`);
console.log(`${colors.cyan}\n现在可以运行: npx mutual-fund-skills${colors.reset}\n`);
}
})();
MIT License
Copyright (c) 2026 Fund Screener
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
基金分析技能 (Mutual Fund Skills)
基于 Python + AkShare 的公募基金量化筛选工具,提供多种专业策略和深度分析能力,支持通过 BrowserMCP 进行数据交叉验证。
🎯 核心功能
📊 专业筛选策略
| 策略 | 命令 | 排序指标 | 说明 |
|---|---|---|---|
| 红利高股息 | --dividend | 股息率 | 纯股息收益 + 低波动,适合长期持有 |
| 股票型 TOP50 | --stock | 卡玛比率 | 股票型/偏股混合,追求高收益 |
| 固收+ TOP30 | --gushou-plus | 索提诺比率 | 二级债基/偏债混合/一级债基,稳中求进 |
| 智选哑铃 | --smart-pick | 综合评分 | 哑铃结构主动管理基金 |
| Alpha策略 | --stock-alpha | Alpha | 超额收益显著的主动基金 |
| 纯债 | --pure-bond | 夏普比率 | 纯债基金,极低风险 |
| 全市场 | (默认) | 夏普比率 | 全品类基金筛选 |
📈 量化指标体系
- 风险调整收益: 夏普比率、索提诺比率、卡玛比率
- 风险指标: 最大回撤、年化波动率、VaR
- 收益指标: 年化收益率、近1/2/3年收益、股息率
- 持仓分析: 前5大重仓股、行业分布(申万行业)、风格漂移检测
- 基金经理: 从业年限、管理规模、历史业绩
🔍 BrowserMCP 数据验证
AkShare 数据存在已知偏差(基金规模为经理总规模、持仓数据滞后等)。配置 BrowserMCP 后,可通过百度股市通交叉验证并修正:
- 基金规模(单只基金实际规模)
- 前5大持仓(最新季度)
- 近1年收益率
🚀 快速开始
使用 npx(无需安装)
# 红利高股息筛选
npx mutual-fund-skills --dividend
# 股票型基金 TOP50
npx mutual-fund-skills --stock
# 固收+ TOP30
npx mutual-fund-skills --gushou-plus
# 单基金深度分析
npx mutual-fund-skills 000215Python 模块使用
from fund_screener import analyze_single_fund, print_fund_analysis
# 分析任意基金
analysis = analyze_single_fund('000215')
print_fund_analysis(analysis)
# 获取关键指标
print(f"夏普比率: {analysis['风险指标']['夏普比率']}")
print(f"最大回撤: {analysis['风险指标']['最大回撤(%)']}%")
print(f"基金经理: {analysis['基金经理']['基金经理']}")📋 输出指标
风险指标
- 夏普比率: 风险调整后收益 (>0.5良好, >1.0优秀)
- 索提诺比率: 下行风险调整收益(仅惩罚下跌波动)
- 卡玛比率: 年化收益 / 最大回撤(>1.0优秀)
- 最大回撤: 历史上最大亏损 (越小越好)
- 年化波动率: 收益波动程度 (越小越稳定)
收益指标
- 阶段收益: 近1年、近2年、近3年
- 年化收益率: 基于近3年数据计算
- 股息率: 红利策略专用指标
其他指标
- 基金规模: 单只基金实际规模(亿元)
- 股票仓位: 股票占净值比例
- 基金经理: 从业年限、管理规模、最佳回报
- 持仓分析: 前5大重仓股、申万行业分布
📦 安装
方式1:npx 直接运行(推荐)
npx mutual-fund-skills --dividend方式2:克隆仓库
git clone https://github.com/sososun/mutual-fund-skills.git
cd mutual-fund-skills
pip install -r requirements.txt
python fund_screener.py --dividend🔧 依赖
akshare>=1.10.0
pandas>=1.5.0
numpy>=1.21.0📝 更新日志
v2.1.0 (2026-02-24)
- ✨ 新增
--dividend红利高股息基金筛选策略 - ✨ 新增
--smart-pick智选主动基金哑铃结构策略 - ✨ 新增申万行业映射、风格漂移检测、季度持仓分析
- 🔧 修复持仓数据获取年份为动态当前年
- 🔧 修复基金规模优先获取单只基金规模而非经理总规模
- 📝 SKILL.md 新增 BrowserMCP 数据验证工作流文档
v2.0.0 (2026-02-22)
- ✨ 重写固收+筛选策略:精确基金类型匹配 + 索提诺排序
- ✨ 新增卡玛比率、股票Alpha策略筛选模式
- ✨ 所有风险指标基于近3年数据窗口(756天)
- 🔧 修复 Sortino ratio 计算(学术标准公式)
- 🔧 无风险利率更新为 1.8%(2025-02 中国10年期国债)
- 📝 SKILL.md 重写为 OpenClaw AgentSkills 格式
v1.3.0 (2026-02-15)
- ✨ 支持全品类基金分析
- ✨ 智能识别基金类型,针对性分析
v1.2.0 (2026-02-14)
- ✨ 全市场智能筛选(从19,000+只基金中筛选)
- ✨ 单基金深度分析功能
v1.0.0 (2026-02-14)
- 🎉 初始版本发布
⚠️ 免责声明
- 本工具仅供学习研究使用
- 历史业绩不代表未来表现
- 基金投资有风险,入市需谨慎
- 不构成任何投资建议
📄 许可证
MIT License
📮 联系方式
- 邮箱: sososunlove@gmail.com
---
Made with ❤️ by sososun
akshare>=1.10.0
pandas>=1.5.0
numpy>=1.21.0