Analyze portfolio allocation and concentration
analyze_allocationCalculate portfolio allocation weights, concentration (HHI, effective holdings), and sector grouping from NSE classifications. Optionally compare to a target to reveal drift.
Instructions
Compute allocation weights and concentration (HHI, effective holdings count) over a list of positions. Deterministic — computed in code, not estimated. Grouping by sector uses NSE's published macro-economic classification looked up by ISIN or symbol, not a sector you supply; instruments outside that index are reported as Unclassified and counted rather than guessed at. Optionally compare against a target allocation to show drift.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No | Optional target weights, e.g. {"Financials": 30, "IT": 20} | |
| groupBy | No | symbol | |
| positions | Yes |