OPEN-SOURCE SCRIPT

Stock vs Sector Comparison with Highlights

This graph is meant as a support to select a stock that is expected to perform better than the sector.

The graph is based on weekly chart. So this is a medium / long term strategy.

How is expected to be used: when the stock has under performed the sector for some time, there is a natural tendence that it will catch up with the sector again. So, for example, if the color change from green to red, you should consider find another stock in the sector. If the stock looses the green color, but is not red yet, you should wait. And vice versa if you start with red. However, life is not that simple, as you can get fake signal. To mitigate this problem, you can adjust the threshold in the input setting, so just go for the signal after x weeks over/underperforming. You also need remember to select the sector in the settings, as the sector is not give automatically when you select the stock.


Below the sectors used:

Sector Name Ticker
S&P 500 (Market Index) SPY
Technology XLK
Financials XLF
Consumer Discretionary XLY
Industrials XLI
Health Care XLV
Consumer Staples XLP
Energy XLE
Utilities XLU
Communication Services XLC
Real Estate XLRE
Materials XLB

Chart patternsCyclesTrend Analysis

Script de código aberto

No verdadeiro espírito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam compreendê-lo e analisá-lo. Parabéns ao autor! Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Quer usar esse script no gráfico?

Aviso legal