TradingView
TIG_That-Indicator-Guy
2022年5月2日早上1點21分

Intraday Super Sectors v2.0 

S&P 500SP

描述

This indicator plots the two 'Super Sectors' (Cyclical and Defensive) showing intraday change from open

.

For reference:

Defensive Sectors:
XLE Energy (not always considered a true defensive sector, but I've thrown it in here for balance)
XLP Consumer Staples
XLU Utilities
XLV Health Care

Cyclical Sectors:
XLB Materials
XLC Communication Services
XLF Financials
XLI Industrials
XLK Information Technology
XLRE Real Estate
XLY Consumer Discretionary

Sector data retrieved from finance.yahoo.com/quote/SPY/holdings/ on May 1, 2022

You're welcome to update the sector weightings from time to time. Don't worry about making it exactly 100% - the script automatically compensates and dynamically adjusts.

.

Outside of the cash session, you won't see anything (lines, clouds, %change etc.) which is perfectly normal. If you want to check to see if it really works, the 'replay' function might help!

.
.
.

* originally motivated by Cody to finish what I'd started, and feedback from TT and MDSS groups to 'always do better' (thanks guys!)

發布通知

Added option to turn off numerical display of all the individual sectors - helpful if you're using this on a phone!

發布通知

Minor update (bugfix?) to allow script to work if SPY is selected (either RTH or Extended)
評論
MonkeyNo1
I really like the indicator!

1. I wasn't able to save in an indicator template. TV Support was able to locate the iss
MonkeyNo1
Two minor issues I encountered:

1. I wasn't able to save in an indicator template. TV Support was able to locate the issue.
The line:
indicator(" ", overlay = false) needs a title and became savable with this edit
indicator("Super Sectors ", overlay = false)

2. Seems to work fine with SPX Index, but limited when used with SPY.
1. Works fine with SPY when session = extended
2. Does not display either sector lines when session = regular.

Thank you.
TIG_That-Indicator-Guy
Hi @MonkeyNo1,

The reason for the 'blank' title is so that users can change the displayed title easily in settings (as I'm sure you've noticed). If you want to save this in an indicator template, you're welcome to copy-paste-modify the script to give it a 'content' title (as suggested by TV support). Maybe one day TV will allow users to change the displayed title directly (so I don't have to!)

Thanks for the heads up with the SPY issue. I know what is causing the problem, and I know how to fix it. I'll roll out a bugfix update over the weekend 👍
TIG_That-Indicator-Guy
@MonkeyNo1, SPY should now work fine 👍

(I've also updated Market Internals 2.0, which had the same 'feature'!)
theodorewakefield
This is a great indicator, is there any chance we can change the sectors. For instance apply the same methodology to the European markets. The easiest way would be to have user selectable symbols for the sectors. I've tried to manually do it, and have come across a few hiccups, will keep trying
TIG_That-Indicator-Guy
@theodorewakefield, thanks. The code is open-source, and fairly self-explanatory - you're welcome to modify it as appropriate!

I'm not familiar with European markets, so can't suggest which sectors you'd need to implement.

In order to have it make some sense, you’d want to have three fields on each of 11 (or whatever) lines …
‘SYMBOL’, ‘WEIGHTING’, ‘SECTOR’. The rest of the code should be easy to update
tacct1
The indicator doesn't work. It shows NaN for all the values :/
TIG_That-Indicator-Guy
@tacct1, don't worry, it works just fine :)

Note that it's an INTRADAY indicator, so if you try to use it outside of the cash session (which, judging from the time of your comment, is what you tried to do) it won't have anything to display!

If you want to see how it works before the markets are open, you can use TV's awesome 'replay' feature
sameboyhere
@TIG_That-Indicator-Guy, Can you please let me know how to use TV's replay feature for this indicator.
TIG_That-Indicator-Guy
@sameboyhere, I'm sure Trading View has some very good tutorials - far better than I can explain in a brief comment - on how to use its features.

Alternatively, you can wait until tomorrow, and see how it works 'live'!
更多