OPEN-SOURCE SCRIPT
已更新 Custom Sector Comparison Index (CSCI)

Compare any stock against a custom basket of its true peers.
Most traders compare stocks to broad indexes like the S&P 500 (SPY) or the Nasdaq (QQQ). But if you are analyzing a niche sector—like Residential REITs, Gold Miners, or AI Semis—broad indexes are too noisy.
This indicator allows you to build your own Custom Equal-Weight Index made up of up to 12 specific symbols. It then plots the performance of the stock you are currently viewing against that custom index, starting from a specific "Anchor Date" of your choosing.
Why use this?
Standard relative strength tools force you to compare against a single symbol (like SPY). But if you want to know if Centerspace (CSR) is lagging its direct competitors, comparing it to SPY (which contains Tech and Healthcare) is useless. Comparing it to VNQ (which contains Cell Towers and Malls) is also imperfect.
With this tool, you can create a "Pure Residential REIT" index and see exactly how your stock is performing against the group.
Key Features:
Fully Configurable: Input up to 12 different symbols to build your custom index.
Smart Filtering: Automatically ignores blank slots. You can build a basket of 3 stocks or 12 stocks without breaking the math.
Custom Anchor Date: Set the specific start date for the comparison (e.g., YTD, Q3 start, or a specific market event).
Visual Performance Gap: Green shading indicates your stock is outperforming the basket; Red shading indicates underperformance.
Example Use Case: Residential REITs
I developed this to analyze the "Residential REIT" sector. I wanted to see if Invitation Homes (INVH) was trading at a discount due to fundamentals or if the whole sector was down.
I configured the basket with 9 of its closest peers:
NYSE:VRE, NYSE:UDR, NYSE:MAA
NYSE:EQR, NYSE:CSR, NYSE:ESS
NYSE:CPT, NYSE:AVB, NYSE:AMH
The Result: The indicator draws a gray line representing the average return of those 9 "Big Boys." I can then load CSR on the chart and immediately see if it is lagging the pack (a potential value buy) or leading it.
How to Use:
Add the indicator to your chart.
Open Settings (Double-click the line).
Start Date: Set the date you want the "race" to begin (where all returns reset to 0%).
Symbols: Type in the tickers for your custom basket (e.g., NVDA, AMD, INTC). Leave unused slots blank.
Analyze:
Gray Line: The average performance of your basket.
Blue Line: The performance of the current symbol on your chart.
Pro Tip: You can save different "Presets" in the indicator settings for different sectors (e.g., save one preset as "Semis" and another as "Oil Majors") so you don't have to re-type symbols every time.
Most traders compare stocks to broad indexes like the S&P 500 (SPY) or the Nasdaq (QQQ). But if you are analyzing a niche sector—like Residential REITs, Gold Miners, or AI Semis—broad indexes are too noisy.
This indicator allows you to build your own Custom Equal-Weight Index made up of up to 12 specific symbols. It then plots the performance of the stock you are currently viewing against that custom index, starting from a specific "Anchor Date" of your choosing.
Why use this?
Standard relative strength tools force you to compare against a single symbol (like SPY). But if you want to know if Centerspace (CSR) is lagging its direct competitors, comparing it to SPY (which contains Tech and Healthcare) is useless. Comparing it to VNQ (which contains Cell Towers and Malls) is also imperfect.
With this tool, you can create a "Pure Residential REIT" index and see exactly how your stock is performing against the group.
Key Features:
Fully Configurable: Input up to 12 different symbols to build your custom index.
Smart Filtering: Automatically ignores blank slots. You can build a basket of 3 stocks or 12 stocks without breaking the math.
Custom Anchor Date: Set the specific start date for the comparison (e.g., YTD, Q3 start, or a specific market event).
Visual Performance Gap: Green shading indicates your stock is outperforming the basket; Red shading indicates underperformance.
Example Use Case: Residential REITs
I developed this to analyze the "Residential REIT" sector. I wanted to see if Invitation Homes (INVH) was trading at a discount due to fundamentals or if the whole sector was down.
I configured the basket with 9 of its closest peers:
NYSE:VRE, NYSE:UDR, NYSE:MAA
NYSE:EQR, NYSE:CSR, NYSE:ESS
NYSE:CPT, NYSE:AVB, NYSE:AMH
The Result: The indicator draws a gray line representing the average return of those 9 "Big Boys." I can then load CSR on the chart and immediately see if it is lagging the pack (a potential value buy) or leading it.
How to Use:
Add the indicator to your chart.
Open Settings (Double-click the line).
Start Date: Set the date you want the "race" to begin (where all returns reset to 0%).
Symbols: Type in the tickers for your custom basket (e.g., NVDA, AMD, INTC). Leave unused slots blank.
Analyze:
Gray Line: The average performance of your basket.
Blue Line: The performance of the current symbol on your chart.
Pro Tip: You can save different "Presets" in the indicator settings for different sectors (e.g., save one preset as "Semis" and another as "Oil Majors") so you don't have to re-type symbols every time.
版本注释
Compare any stock against a custom basket of its true peers.Most traders compare stocks to broad indexes like the S&P 500 (SPY) or the Nasdaq (QQQ). But if you are analyzing a niche sector—like Residential REITs, Gold Miners, or AI Semis—broad indexes are too noisy.
This indicator allows you to build your own Custom Equal-Weight Index made up of up to 12 specific symbols. It then plots the performance of the stock you are currently viewing against that custom index, starting from a specific "Anchor Date" of your choosing.
Why use this?
Standard relative strength tools force you to compare against a single symbol (like SPY). But if you want to know if Centerspace (CSR) is lagging its direct competitors, comparing it to SPY (which contains Tech and Healthcare) is useless. Comparing it to VNQ (which contains Cell Towers and Malls) is also imperfect.
With this tool, you can create a "Pure Residential REIT" index and see exactly how your stock is performing against the group.
Key Features:
Fully Configurable: Input up to 12 different symbols to build your custom index.
Smart Filtering: Automatically ignores blank slots. You can build a basket of 3 stocks or 12 stocks without breaking the math.
Custom Anchor Date: Set the specific start date for the comparison (e.g., YTD, Q3 start, or a specific market event).
Visual Performance Gap: Green shading indicates your stock is outperforming the basket; Red shading indicates underperformance.
Example Use Case: Residential REITs
I developed this to analyze the "Apartment REIT" sector. I wanted to see if Centerspace (CSR) was trading at a discount due to fundamentals or if the whole sector was down.
I configured the basket with 9 of its closest peers:
NYSE:VRE, NYSE:UDR, NYSE:MAA
NYSE:EQR, NYSE:INVH, NYSE:ESS
NYSE:CPT, NYSE:AVB, NYSE:AMH
The Result: The indicator draws a gray line representing the average return of those 9 "Big Boys." I can then load CSR on the chart and immediately see if it is lagging the pack (a potential value buy) or leading it.
How to Use:
Add the indicator to your chart.
Open Settings (Double-click the line).
Start Date: Set the date you want the "race" to begin (where all returns reset to 0%).
Symbols: Type in the tickers for your custom basket (e.g., NVDA, AMD, INTC). Leave unused slots blank.
Analyze:
Gray Line: The average performance of your basket.
Blue Line: The performance of the current symbol on your chart.
Pro Tip: You can save different "Presets" in the indicator settings for different sectors (e.g., save one preset as "Semis" and another as "Oil Majors") so you don't have to re-type symbols every time.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。