OPEN-SOURCE SCRIPT
Cumulative New Highs - New Lows Indicator

This indicator is designed to track market momentum by calculating and plotting the cumulative sum of 52 weeks High-Low for different indices, alongside a customizable moving average.
Index Selection:
Users can choose from multiple indices, including:
Moving Average Customization:
The script allows you to select between a Simple Moving Average (SMA) or an Exponential Moving Average (EMA) for smoothing the cumulative data. The window length of the moving average is also adjustable, letting you tailor the sensitivity of the trend analysis.
Dynamic Background Plotting:
With the background plot option enabled, the indicator changes the chart's background color dynamically:
Visual Representation:
Two key lines are plotted:
Inspiration:
I took inspiration from the indicator made by YoxTrades (I can't put links, but you can check their profile) and added a few features I wanted on top of it.
Index Selection:
Users can choose from multiple indices, including:
- Total Stock Market (default)
- NYSE Composite
- Nasdaq Composite
- S&P 500
- Nasdaq 100
- Russell 2000
Moving Average Customization:
The script allows you to select between a Simple Moving Average (SMA) or an Exponential Moving Average (EMA) for smoothing the cumulative data. The window length of the moving average is also adjustable, letting you tailor the sensitivity of the trend analysis.
Dynamic Background Plotting:
With the background plot option enabled, the indicator changes the chart's background color dynamically:
- Green: When the cumulative sum is above its moving average, suggesting bullish momentum.
- Red: When it is below the moving average, indicating bearish conditions.
Visual Representation:
Two key lines are plotted:
- Cumulative Index Line: Displayed in a subtle blue, representing the aggregated market movement.
- Moving Average Line: Shown in an orange tone, offering a smoothed perspective that aids in identifying trend shifts.
Inspiration:
I took inspiration from the indicator made by YoxTrades (I can't put links, but you can check their profile) and added a few features I wanted on top of it.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.