OPEN-SOURCE SCRIPT
Weekly 10/20/30/40 SMA Overlay

This indicator plots the 10, 20, 30, and 40-week Simple Moving Averages (SMAs) on any chart timeframe.
The purpose is to provide a higher-timeframe trend framework that can help traders and investors determine the overall market environment.
How to Use
Bullish Trend:
Price above all four SMAs.
10-week above the 20-week.
20-week above the 30-week.
30-week above the 40-week.
This suggests institutional participation may be supporting higher prices.
Bearish Trend:
Price below all four SMAs.
10-week below the 20-week.
20-week below the 30-week.
30-week below the 40-week.
This suggests the longer-term trend may be weakening or trending lower.
Transition / Consolidation:
The moving averages flatten or become intertwined.
This often indicates a market that is:
consolidating,
changing trend,
or lacking clear directional conviction.
Notes
This indicator is not intended as a standalone buy or sell signal.
It is designed to help traders and investors align themselves with the broader market trend.
Many trend-following approaches use higher-timeframe moving averages as a filter for position management and directional bias.
The purpose is to provide a higher-timeframe trend framework that can help traders and investors determine the overall market environment.
How to Use
Bullish Trend:
Price above all four SMAs.
10-week above the 20-week.
20-week above the 30-week.
30-week above the 40-week.
This suggests institutional participation may be supporting higher prices.
Bearish Trend:
Price below all four SMAs.
10-week below the 20-week.
20-week below the 30-week.
30-week below the 40-week.
This suggests the longer-term trend may be weakening or trending lower.
Transition / Consolidation:
The moving averages flatten or become intertwined.
This often indicates a market that is:
consolidating,
changing trend,
or lacking clear directional conviction.
Notes
This indicator is not intended as a standalone buy or sell signal.
It is designed to help traders and investors align themselves with the broader market trend.
Many trend-following approaches use higher-timeframe moving averages as a filter for position management and directional bias.
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.
N33RK9
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.
N33RK9
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.