Tom1trader

S&P Sector Advance/Decline Weighted -Tom1trader

Tom1trader 已更新   
Enjoy, enhance your trading (I hope), copy or adapt to your needs and keep smiling!

Thanks to @MartinShkreli. The sector variables and the "repaint" option (approx lines 20 through 32 of this script) are used directly from your script "Sectors"
RECOMMENDATION: Update the sector weightings -inputs are provided. They change as often as monthly and the
annual changes are certainly significant. When updating weighting percentages use the decimal value. I.E. 29% is .29

Good on any time frame. Especially SPY, SPX and ES scalpers and 0DTE options traders may like this a lot.

This gives good signals on S & P and related (ES, SPY) and indicates / plots differently than the AD line or ratio.
Each sector's entire % weight is added or subtracted depending of whether that sector advanced or declined.
Example: Information Tech weight at 29% so that % of 500 (145) is added if InfoTech is up a penny and subtracted if it is
down a penny. All sectors processed the same way so that for a given bar/candle the value will be between +500 (all
sectors up) and -500 (all sectors down). This weighted AD line of sectors is scaled to +/- 350 and plotted as a red/green line
along with aqua/fuchsia columns of its 5 period ema. The line is actual sector behavior and the columns seem to make a
good signal with column zero crosses standing out.

The columns aqua / fuchsia are a 5 period ema of the Sector AD line and give pretty good signals at
zero cross for SPX. I colored the AD red green line also to emphasize the times it opposes the ema
for example the histo/colums zero cross signal is NOT true when the AD line is showing all or most sectors
going the other way.

For readability, the AD line itself is scaled to 350. This lets the columns of the ema stand out better. The hlines at
350 and at 175 give an idea for the AD green red line how much of the sector's weight is up or down.
350 is all sectors up (advancing) and -350 is all sectors down (declining). The hlines at +/- 175 seem to outline
a more or less "neutral" zone. For example in an uptrend with most of the AD level positive and the columns positive;
a negative spike that does not pass the -175 line and returns positive does not seem to impact the price as much as
a deeper negative spike.
版本注释:
Thanks to @MartinShkreli. The sector function, variables & "repaint" (approx lines 28 through 43 of this script)
are used directly from your script "Sectors"
RECOMMENDATION: Update the sector weightings -inputs are provided. They change as often as monthly and the
annual changes are certainly significant.
When updating weighting percentages use the decimal value. I.E. 29% is .29
All sectors advanced is line at +1 and declined at -1
Line values between +/- 1 represent percentage of sector weight that advanced or declined

The weight (% S&P mkt cap) is added if advances or subtracted if declines
i.e infotech sector was 26% of S&P when I did this so .26 added/subtracted when advance/decline.
The columns aqua fuchsia are a 5 period Hull Moving Average

Zero Cross of this histo/columns give pretty good signals for S&P.
Above/below zero track pretty well as price rising/falling.
The space between plus 0.5 and minus 0.5 is more neutral such that
when histo is between them price is rising or falling more slowly
or price is ranging when histo straddles back and forth + and -.
I colored the AD line also to emphasize the times it opposes the histo.

--New version changes:
- EMA to Hull Moving Average
- Scaling to +/- 1 simplifies code and inputs
- Choice of plot multiple for histo readability (1x-2x in 0.1 steps)
- Cleaned up and clarified description
版本注释:
Updated the sector weightings per Yahoo Finance, link in description. The original source of the weightings no longer posts them on their web site so changed to Yahoo's. Changed input dialogue on Consumer Staples and Discretionary to show that discretionary is also cyclical and stapes is also defensive. If you update with the inputs provided it is clear when yahoo says only cyclical it is the same as discretionary and same with defensive/staples.
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?