McClellan Oscillator [LazyBear ~ modified]

The McClellan Oscillator is a market breadth indicator developed by Sherman and Marian McClellan.

It is calculated from Net Advances, which is the number of advancing issues minus the number of declining issues. Subtracting the 39-day exponential moving average of Net Advances from the 19-day exponential moving average of Net Advances forms the oscillator.

The McClellan Oscillator can be traded with breadth thrusts, centerline crossovers and divergences.

The original code was written by LazyBear - I just modified it to add together all advancing and declining issues from all stock exchanges (NYSE + NASDAQ + others), to make it available on the hourly time frame and also add alerts.
הערות שחרור: Added the possibility of using only a percentage of each stock exchange's advancing and declining issues. You can do this in settings - for example you can use 100% of the NASDAQ advancing/declining issues, and 50% of NYSE. This is good for experimenting.
סקריפט קוד פתוח

ברוח TradingView אמיתית, מחבר סקריפט זה פרסם אותו עם קוד פתוח, כך שסוחרים יוכלו להבין ולאמת זאת. הידד למחבר! אתה יכול להשתמש בו בחינם, אך שימוש חוזר בקוד זה בפרסום הנו בכפוף ל כללי הבית . אתה יכול להגדירו כמועדף ולהשתמש בו בגרף.

רוצה להשתמש בסקריפ זה בגרף?


Thanks for this indicator! One question, though: If using this indicator on an index (e.g. the NASDAQ 100), does one run the McC indicator on all stock data or only on data of the securities which are actually listed within that index?
Amazing job, is possible to adapt to have the value adjusted to how many stocks the indicator is using in total? I mean the sum of advance and declines. Like the adjusted Mcclellan Oscilator formula in this link: https://www.investopedia.com/terms/m/mcclellanoscillator.asp )
Sir can we update this indicator with volume wise advance and decline....that will show cash inflow and outflow.....by the use of stock components of index
great edits, really like the improvements
This is really useful and well put together, thanks for the effort!
Is US the S&P 500?