TradingView
viewer405
19 ago 2022 20:36

Advance Decline Index 

SPDR S&P 500 ETF TRUSTArca

Descrizione

In index investment, the USI:ADD is the Advance Decline Index that can be plotted in most charting platforms. Just like there is a volatility index for most major indeces (VIX, VOLQ) and even for Apple (CBOE:VXAPL), USI:ADD also has variations specific for the index you are analyzing (SPX: ADD, NASDAQ: ADDQ).

The USI:ADD index is a measurement of stocks in the index that are advancing (bullish) minus those that are declining (bearish), the exact formula being ADV minus DECL.

The basic idea of how to use the ADD index is that when the value is above 1000 it is considered overbought. Conversely, when the value is below -1000 it is considered oversold. When the value is near the medium line, it is not a good idea to trade as it is considered to be in a choppy market.

This script attempts to identify the correct Advance Decline Index for the index you are analyzing. It will plot the overbought and oversold levels that are applicable to the ADD line. If you are analyzing a stock, it will use the most appropriate ADD line for that stock sector or exchange.

Note di rilascio

Added workaround for data issue with daily USI:ADD candlesticks.

Note di rilascio

Added two optional moving averages that can be customized for length, type (EMA or SMA), etc.

Note di rilascio

Added checkbox to enable/disable moving averages. Also made the checkbox false by default. Minor bug fix.

Note di rilascio

Fixed some bugs kindly pointed out by other users. Thank you all for your positive feedback!

Note di rilascio

Simplified the indicator to display exactly what you need:
  1. the raw ADD data with +/- 2000 threshold
  2. the ADD ratio


Also added some tooltips to better explain what the indicator settings do. Now you can just switch the mode to 'ratio' and the indicator will automatically remove the threshold lines used for the raw data. Please keep your feedback coming!
Commenti
Caroray
Thank you for your work :)
viewer405
@Caroray, thank you for your support! Let me know if there's anything I can improve on. I love feedback and suggestions.
Mr_Iniyan
Thank you for this. Not able to understand why USI:ADD shows value of less than -500 and greater than +500 when s&p500 is of only 500 components.
iMiPi
I think there are two mistakes in the input default at options
First: "DD" in each USI:ADDV***.**
Second: missing .** in the last option "USI:ADDVDEC"
I'm not sure about a third issue: the script editor displays your variable named "type" with blue text color because it's recognized as a keyword of pinescript. Maybe that could cause a problem in some situations, unless you change the name to a non-keyword.
You used the correct spelling with only a single "D" in another part in the code at index switch "USI:ADVDEC.DJ" and "USI:ADVDEC.DJ".
viewer405
@iMiPi, thank you so much for pointing this out. I've made the changes as you pointed out.
iMiPi
@viewer405, You're welcome. I also did some work on your script, just for myself. I never published a script, so I'm not sure whether I should and what would be the proper, decent way to do it, since it's based on your script. If you want to see it, let me know what would you like me to do to give you credit properly.
sebbipanza
thank you for your work, does this then work for any exchange or just in the US ? :)
viewer405
@sebbipanza, this works for the S&P 500, Nasdaq and the Dow Jones indices. The same goes for the VOLD and TICK indicators. If there is a ticker symbol for an index for the Norwegian or Swedish stock market, please share that with me so I can try to code them in. I am not familiar with any of those markets, so you would have to inform me on what indices you're looking for.
Teclaro
@viewer405, how can I add this to the Chilean index? it's SP_IPSA
Altro