Fund Investment Portfolio Analysis
Objective and Scope
Performs a verifiable quantitative and structural analysis of a fund holding portfolio. Default output is a Chinese searchable PDF. Applicable to equity funds, hybrid funds, index funds, bond funds, money market funds, commodity funds, gold funds, etc. Assets outside funds should have their type and statistical boundary clearly defined if included.
The report presents verified data, calculation results, and necessary brief annotations only. It must not default to outputting "core judgments", "immediate actions", "priority studies", "buy/sell/swap recommendations", or "sector increase/decrease instructions"; asset structure alone does not imply trading advice. When the user requests trading decisions, a separate analysis is required, which must include real-time valuations, fundamentals, holding period, actual fees, risk tolerance, available capital, and trading opportunity costs. Otherwise, clearly state that reliable judgment is not possible, and do not present theoretical calculations as investment recommendations.
Input and Classification
- Required: Each fund's code or name, current market value
V, current accumulated holding gain/lossP(positive for profit, negative for loss); default currency is CNY; account snapshot date must be specified. - Optional: Fund name, fund type, primary investment category, share class, purchase and redemption records, dividends, fees, cost details, etc.
- Sold funds are not included in current holdings; if the user provides realized losses separately, record them independently and do not automatically mix them with current holdings' market value and gain/loss.
- Holding classification is determined based on fund contracts, periodic reports, and fund attributes explicitly provided by the user. Mark as "unclassified" if verification is not possible. The same market value can only be placed in one primary category; duplicate statistics are prohibited. Classification is a fund-level statistical grouping, not a proxy for underlying security allocation percentages.
- If the user only provides a code without a category, public information may be verified with publicly available data; do not mislabel different input dates as actual holdings on the same day. All reports must clearly indicate the user's account snapshot date and external data dates.
C = V - Pis the imputed current holding cost derived from the account's holding gain/loss, not necessarily the sum of all historical cash flows. When partial redemptions, dividends, or account transfers have occurred, this limitation must be stated.
Precise Calculations
Use decimal arithmetic (Decimal) for all operations; round only for display purposes. The minimum top-up amount must be rounded up to the nearest cent.
Let V = current market value of the holding, P = accumulated holding gain/loss, C = V - P, and r > 0 be the hypothetical future rise percentage from the current price.
| Metric | Formula |
|---|---|
| Holding return rate | P / C |
| Rise needed to break even without top-up for a single losing fund | -P / V |
Additional amount needed for a single fund to break even assuming future rise r | A = max(0, -P / r - V), 0 if already profitable |
Rise needed to break even after top-up A | -P / (V + A) (when losing) |
| Portfolio total market value, total gain/loss, total cost | ΣV, ΣP, ΣC |
| Portfolio total return rate, overall break-even rise without top-up | ΣP / ΣC, -ΣP / ΣV when losing |
| Total top-up for each fund to break even individually | Σ max(0, -Pᵢ / r - Vᵢ) (zero for profitable items) |
| Theoretical top-up to offset entire account level | max(0, -ΣP / r - ΣV), assuming all holdings rise uniformly by r |
Default scenarios: r = 10% and r = 20%; users can modify. For positive top-up amounts, verify (V + A) × (1 + r) ≥ C + A using exact decimals. Do not output additional explanations of top-up principles, sample calculations, or portfolio break-even scenario pages by default, ensuring non-professional readers can directly view the tables.
PDF Fixed Content (Two Pages Only by Default)
Unified Report Name and Cover Title: Fund Investment Portfolio Analysis. Do not use alternative main titles like "Diagnosis", "Core Judgment", or "Action Recommendations".
- Account Overview: Snapshot date, number of holdings, current market value, imputed cost, accumulated gain/loss, overall return rate, overall break-even rise. Present only numbers and necessary definitions; do not include investment opinions or duplicate asset allocation charts.
- Single Holdings Summary Table:
Fund/Code | Current Market Value | Gain/Loss & Return Rate | Rise Needed to Break Even Without Top-Up | Top-Up Needed to Break Even if Future Rise 10% | Top-Up Needed to Break Even if Future Rise 20%. End the table with a brief note: the two columns of totals are calculations for each fund to break even individually, not investment advice. Use red for loss figures and green for profits; highlight individual top-up amounts ≥ CNY 10,000 in bold red and flag them as high amounts; users can modify the threshold. Amounts are precise to the cent. Do not add a column for "current action/judgment" without sufficient evidence. - Asset Allocation: Include only one set of detailed horizontal bar charts with text labels. Each row directly shows the category, bar, percentage, and amount. Categories are mutually exclusive, and the sum of amounts equals the total market value. Attach a list of funds under each category, the maximum single holding percentage, and the classification methodology. Do not draw duplicate colored horizontal stacked charts on the first page or above the chart; do not include charts without text labels.
Do not generate swap analysis, timing analysis, pre/post adjustment comparisons, or inferential sector increase/decrease content by default. These belong to a separate trading research task requiring evidence and cannot be derived from market values, gains/losses, and allocation proportions alone.
Presentation and Quality
- A4 portrait, Chinese, searchable; text in charts and tables must be clear and readable, suitable for zooming on mobile devices; page count should be content-complete, not artificially filled or expanded.
- Use stable color schemes for categories, but category text and values must be displayed directly alongside the bars. Highlight high top-up amounts in red; do not overuse colors for ordinary amounts and titles.
- Do not derive action opinions (e.g., "worth adding", "needs selling", "should buy broad market") from original holding losses or conditional top-up amounts; do not add general market outlook judgments.
- PDF filename:
Fund_Investment_Portfolio_Analysis_YYYY-MM-DD.pdf. Retain the snapshot date for cross-period comparison. - After generation, render and inspect the holdings table and category bar chart for Chinese text overlap and missing characters; verify
ΣC = ΣV − ΣPand group amount conservation.
Generation Method
Utility scripts:
scripts/portfolio_calc.py: Decimal precision calculations and amount validation.scripts/build_report_pdf.py: Reads JSON, invokes the calculation script, and generates a Chinese PDF; supports--htmlto output HTML for review.
Run: python scripts/build_report_pdf.py input.json output.pdf. Example input structure:
{
"as_of": "YYYY-MM-DD",
"currency": "CNY",
"scenarios": ["0.10", "0.20"],
"highlight_threshold": "10000",
"positions": [
{"code": "Fund Code", "name": "Fund Abbreviation", "market_value": "Current Market Value", "pnl": "Current Gain/Loss", "category": "Fund Primary Category"}
],
"sold_excluded": []
}
The ZIP should contain only the generic skill, calculation, and PDF scripts, with no user holdings, historical discussions, or case-specific trading conclusions.