Skip to content
All library documents

Building a Custom Capitalization-Weighted Index from Selected Stocks

Article TradingView scripts

Summary

This indicator constructs a synthetic index from a user-selected basket of up to 34 symbols. It retrieves constituent prices and share counts, estimates each holding’s market capitalization, and derives weights from the holdings’ relative capitalization. Users can enable or exclude symbols and choose the index name, currency, chart style, and table presentation.

The script also displays constituent prices, daily percentage changes, estimated market capitalizations, and portfolio weights, with sorting options for the holdings table. It can plot the resulting index as candles, bars, or a line. Symbols without the necessary share-count data are excluded and identified in the display. The document explains the calculation and interface but offers no validation against an official benchmark, treatment of corporate actions, or performance testing, so the generated series should be understood as a customizable analytical construction rather than a demonstrated investable index.

Key ideas

  • The indicator builds a synthetic index from a configurable basket of as many as 34 symbols.
  • Constituent weights are based on estimated market capitalization using price and shares outstanding.
  • Users can inspect holdings, daily changes, market capitalization, and index weights in a sortable table.
  • Symbols without share-count data are excluded from the index.
  • The document provides no benchmark comparison or performance validation.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.