OPEN-SOURCE SCRIPT
Colored Moving Averages Can Help You Spot Trends

Moving averages are perhaps the most popular indicator in technical analysis. But sometimes they're not the easiest to interpret.
This indicator helps you see the trend by coloring the MA based on its direction. It's green when rising and red when falling. Of course, you can easily change that in the Style tab under Settings.
Color MA also lets you select from five different types of moving averages, including simple, exponential and Hull. We've included a list for easy reference below. Just change the "AvgType" on the Input tab under Settings.
This chart of
Facebook shows the 20-day simple moving average. Notice how swings often marked turns in the stock price.
AvgType codes:
1 - Simple Moving Average
2 - Exponential Moving Average
3 - Hull Moving Average
4 - Weighted Moving Average
5 - Volume Weighted Moving Average
This indicator helps you see the trend by coloring the MA based on its direction. It's green when rising and red when falling. Of course, you can easily change that in the Style tab under Settings.
Color MA also lets you select from five different types of moving averages, including simple, exponential and Hull. We've included a list for easy reference below. Just change the "AvgType" on the Input tab under Settings.
This chart of
AvgType codes:
1 - Simple Moving Average
2 - Exponential Moving Average
3 - Hull Moving Average
4 - Weighted Moving Average
5 - Volume Weighted Moving Average
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.
For quick access on a chart, add this script to your favorites — learn more here.
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.
For quick access on a chart, add this script to your favorites — learn more here.
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.