This script attempts to show the relative strength of the 11 sectors in the SPX, which can be accomplished in three ways:

1. Sectors - displays all sector indices as they appear normally

2. Sector Relativity - displays each sector divided by the sum of the other 10 sectors

3. Sector Alpha - displays the alpha of each sector as compared to the sum of the other 10 sectors


I have seen some other iterations of this script that compare each sector to the SPX as a whole, a couple problems with that:

1. SPX sector weightings are unequal and change quarterly, meaning you will get an inaccurate depiction of relative sector strength across time.

2. Even if using an equal-weight SPX, you would be comparing a sector to itself as all 11 sectors are included in the SPX, not just the complementary 10 you are looking to compare one sector to.


For more information on the sectors in the SPX or the calculation of Alpha, visit the links at the top of the script.


*Includes an option for repainting -- default value is true, meaning the script will repaint the current bar.
False = Not Repainting = Value for the current bar is not repainted, but all past values are offset by 1 bar.
True = Repainting = Value for the current bar is repainted, but all past values are correct and not offset by 1 bar.
In both cases, all of the historical values are correct, it is just a matter of whether you prefer the current bar to be realistically painted and the historical bars offset by 1, or the current bar to be repainted and the historical data to match their respective price bars.
As explained by TradingView,`f_security()` is for coders who want to offer their users a repainting/no-repainting version of the HTF data.

오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?