There is also an option to configure the moving average lengths. The default for a is to calculate the 50-day moving average. On a weekly chart, the default is the 10-week moving average.
■ Configure moving average lengths for various chart timeframes.
■ Set width of bars.
■ Option to set bar color based on the previous close.
Learning Pine Script / Creating Your Own Indicators
One goal of this indicator is help others who are interested to learn Pine Script. The code is open source and I've included an abundance of comments. In future updates, I'll show additional Pine Script features and scripting concepts.
■ Minor updates to the interface.
■ Update to how the volume bar colors are determined.
■ Updated formatting of the volume scale on the right.
If you find the free indicators helpful, donations are welcome:
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.