Stock Portfolio Analysis Master
Paste the following prompt into your AI chat to install this skill:
Please follow https://skillhub.cn/install/skillhub.md to install @user_fad4194b/portfolio-analysis-pro.
About this skill
Problem
Managing a stock portfolio often involves only a few concrete tasks: recording positions, refreshing prices, calculating P&L, and exporting reports. Spreadsheets become hard to maintain when positions change, prices need repeated updates, and there is no reliable audit trail. This skill organizes that workflow into callable APIs and a manager class, making it easier to build a local portfolio-analysis entry point.
Capabilities and workflow
- Position management: supports adding, editing, and deleting positions, including stock code, name, quantity, and cost price.
- Price updates: allows manual full-price refreshes, and optional automatic updates during trading hours. Automatic updates are limited to weekdays from
9:30-11:30and13:00-15:00. - P&L analysis: calculates total market value, total cost, total P&L, P&L percentage, per-stock P&L, and position weights, with sorting by name, code, market value, P&L amount, or P&L percentage.
- Reports and auditability: generates
Markdownreports and supports export, while also logging operation history for review.
Key entry points include APIs such as GET /api/portfolio, POST /api/portfolio/add, PUT /api/portfolio/edit-multiple/, and GET /api/portfolio/report. The underlying logic can also be reused through the PortfolioManager class.
Boundaries
This skill is focused on position tracking and analysis, not a full trading system. Price-related values use 4-decimal precision, with red indicating profit and green indicating loss. Supported stock codes cover common 6-digit Shanghai, Shenzhen, and ChiNext formats. For multi-account workflows, tax calculation, advanced risk control, or automated execution, additional systems are required.
Use Cases
- Maintain multiple A-share positions by adding, batch editing, or deleting records with cost price.
- Refresh all holding prices during trading hours and review total market value, total P&L, and position weights.
- Review a past trade by querying a single stock price and checking operation history.
- Generate a Markdown portfolio report, sort it by P&L percentage, and export the file.
Best For
- Investment ops staff moving A-share holdings from spreadsheets into queryable APIs
- Research assistants producing periodic P&L reports for team review
- Python developers managing personal stock records through a local service
- Portfolio managers auditing trade changes and cost-price updates
Related Skills
Covers literature review, data analysis, visualization, drug discovery, paper writing, and grant writing workflows.
A retrieval assistant for Chinese laws and regulations, supporting semantic queries, validity checks, clause location, and regulation comparison with CLI-based output.
Run questionnaire-based tax risk scans that generate red/orange/yellow alerts with industry templates, policy references, remediation actions, and local trend tracking.
A contract review assistant for legal and business teams that extracts clauses, flags risks, compares versions, and generates opinion reports with a built-in legal knowledge base.