P

股票持仓分析大师

Professionalv1.0.0
By user_fad4194bUpdated 2026-10-01portfolio-analysis-pro@user_fad4194b/portfolio-analysis-pro
Finance

According to AlphaMoat, as of 2026-09, 股票持仓分析大师 has 2,797 downloads and 0 stars — ranked #3,874 of 5,078 AI skills overall, and #324 of 465 in Professional.

Installs
103
Downloads
2.8K
Stars
-
Overall Rank
#3,874
Top 77% overall · Top 70% in Professional
PlatformInstallsDownloadsStarsComments
SkillHub ↗1032.8K-—

Platforms count differently and update at different times.

What this skill does

It describes adding, editing, or deleting holdings, updating prices, calculating market value and profit/loss, viewing operation logs, generating Markdown reports, and querying an individual stock price. Examples use a local PortfolioManager or Flask API. Price updates depend on external data sources and may be delayed or incomplete. Analysis is informational, not investment advice; verify the target record before changing or deleting a holding.

Profile published 2026-10-29

What you can do with it

  • Record and review holding information such as symbols, quantities, and cost basis.
  • Update prices and organize portfolio profit/loss and allocation analysis.
  • Generate or export portfolio reports and trace operation history.

When to use it

  • When maintaining stock-holding records or reviewing a portfolio.
  • When updating holding prices and summarizing profit/loss.
  • Before adding, editing, or deleting holdings, or relying on prices for a decision, when the target record, data source, and freshness need verification.

Example prompts

Generated from the skill’s documentation as examples; not results of actual runs.

Summarize the holdings I provide and flag any price source or update time that is unknown.
List the fields to verify before editing or deleting this holding record; do not submit the change.

Monthly Trend

Downloads2.8K
01.5K3.0K2026-03 · Downloads 502026-05 · Downloads 4512026-06 · Downloads 7212026-07 · Downloads 1.2K2026-08 · Downloads 1.7K2026-09 · Downloads 2.8K26-0326-09
Stars-
0112026-03 · Stars -2026-05 · Stars -2026-06 · Stars -2026-07 · Stars -2026-08 · Stars -2026-09 · Stars -26-0326-09

The counting method changed in 2026-09: skills with the same name are now counted separately by author, and the full catalog is covered. Dashed lines show months before the change; they are not compared with later months, and no growth is computed across the change. Other skills share this name; figures from before the change are attributed to this one, which currently has the most downloads.

MonthDownloadsMoMStars
2026-092.8K—-
2026-081.7K+39.2%-
2026-071.2K+66.7%-
2026-06721+59.9%-
2026-05451—-
2026-0350—-

SKILL.md (original)

The author’s original file, shown as plain text without edits or review by AlphaMoat. Links are not clickable; check commands before running them. Fetched 2026-10-23.

3.9 KB · SkillHub v1.0.0
---
name: portfolio-analysis
description: 股票持仓分析系统,用于管理股票投资组合,实时更新价格,分析盈亏,生成报告。使用当用户需要管理股票持仓、查看实时价格、分析盈亏情况、生成投资报告时。
version: 1.0.0
icon: 📊
metadata:
  clawdbot:
    emoji: 📊
    requires:
      bins: ["python"]
Show all (149 lines)
    install:
      - id: python-deps
        kind: pip
        packages:
          - requests
          - flask
        label: Install Python dependencies for portfolio analysis
---

# 股票持仓分析 Skill

提供股票投资组合管理、实时价格更新、盈亏分析和报告生成功能。

## 功能说明

本skill提供以下功能:

1. **持仓管理** - 添加、编辑、删除股票持仓记录,支持股票代码、名称、持仓数量、成本价的完整编辑
2. **实时价格更新** - 手动或自动更新持仓价格,支持多数据源,自动更新仅在交易时间执行
3. **盈亏分析** - 计算总市值、总成本、总盈亏、盈亏比例、个股盈亏、仓位占比等
4. **操作记录** - 自动记录所有操作历史,支持查看和追溯
5. **报告生成** - 生成Markdown格式的持仓报告,支持下载导出
6. **股票价格查询** - 查询单只股票的实时价格信息

## 使用方法

### 1. 启动系统

```python
from portfolio_system import PortfolioManager, start_server

# 启动Web服务器
start_server(host='0.0.0.0', port=5000, auto_update=True)
```

### 2. 使用API接口

```python
import requests

# 获取持仓数据
response = requests.get('http://localhost:5000/api/portfolio')
data = response.json()

# 更新价格
response = requests.post('http://localhost:5000/api/portfolio/update')

# 添加持仓
response = requests.post('http://localhost:5000/api/portfolio/add', json={
    'symbol': '600519',
    'name': '贵州茅台',
    'quantity': 100,
    'cost_price': 1800.00
})

# 查询股票价格
response = requests.get('http://localhost:5000/api/stock/price/600519')
```

### 3. 使用PortfolioManager类

```python
from portfolio_system import PortfolioManager

manager = PortfolioManager('portfolio.db')

# 添加持仓
result = manager.add_holding('600519', '贵州茅台', 100, 1800.00)

# 获取持仓数据
portfolio = manager.get_portfolio_data()

# 更新所有价格
result = manager.update_all_prices()

# 生成报告
result = manager.generate_report()
```

## API接口说明

| 接口 | 方法 | 说明 |
|------|------|------|
| `/api/portfolio` | GET | 获取持仓数据 |
| `/api/portfolio/update` | POST | 手动更新所有价格 |
| `/api/portfolio/add` | POST | 添加持仓 |
| `/api/portfolio/edit/<symbol>` | PUT | 编辑单个字段 |
| `/api/portfolio/edit-multiple/<symbol>` | PUT | 批量编辑持仓 |
| `/api/portfolio/delete/<symbol>` | DELETE | 删除持仓 |
| `/api/portfolio/logs` | GET | 获取操作记录 |
| `/api/portfolio/report` | GET | 生成持仓报告 |
| `/api/portfolio/export` | GET | 下载报告文件 |
| `/api/stock/price/<symbol>` | GET | 查询单只股票价格 |

## 依赖项

- requests
- flask

安装依赖:
```bash
pip install requests flask
```

## 交易时间

自动更新仅在以下时间段执行:
- 工作日(周一到周五)
- 上午:9:30 - 11:30
- 下午:13:00 - 15:00

## 股票代码格式

- 上海股票:6位数字代码(如 600519)
- 深圳股票:6位数字代码(如 000001)
- 创业板:300开头(如 300750)

## 数据精度

所有价格相关数据支持4位小数精度,包括:
- 成本价
- 当前价
- 盈亏额
- 盈亏百分比

## 颜色标识

- 红色:代表盈利
- 绿色:代表亏损

## 排序功能

持仓列表支持按以下字段排序:
- 股票名称
- 股票代码
- 市值
- 盈亏额
- 盈亏百分比

Popular in Professional

Data month: 2026-09 · Downloads, stars and installs are aggregated monthly from public skill registries (ClawHub, SkillHub). See methodology.