PROTECTED SOURCE SCRIPT
已更新

Make & Track An Index — Custom Weighted (by Quinn Millegan)

12
Fixed pinescript security call issue limiting to 40 calls
發行說明
Build your own weighted index or portfolio tracker from any combination of tickers.
Enter symbols and their weights (in percent, decimals, or fractions — e.g. 50,30,20 or 1/2,1/3,1/6) and this script will calculate and plot your custom index value in real time.

✅ Features

Unlimited symbols via simple CSV entry (e.g. AAPL,MSFT,NVDA,AMZN).

Flexible weighting input — supports percentages, decimals, or fractions.

Optional normalization to make weights sum to 100%.

Color-coded trend detection (blue for up, purple for down).

Optional real-time Price Table showing each component’s price and weight.

Built-in alert condition when the index crosses above its 20-bar SMA.

💡 Example
For a portfolio of AAPL 50, MSFT 40, and NVDA 10, the script produces an index value of roughly 345.34 (as of Oct 2025).

⚙️ Usage

Open the indicator on any chart.

Type your tickers into the Tickers (CSV) box.

Optionally specify Weights (CSV) in any format.

Toggle “Normalize Weights” if you want the total to equal 100%.

This tool was developed by Quinn Millegan of the Woodworth Contrarian Fund to visualize weighted portfolios, custom benchmarks, or thematic baskets (e.g. “AI Index,” “Cloud SaaS Basket,” etc.).

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。