TradingView

Chart CAGR

█ OVERVIEW


This simple script displays in the lower-right corner of the chart the Growth Rate and the Compound Annual Growth Rate (​CAGR) between the open of the chart's first visible bar and the close of its last bar. As you zoom/scroll the chart, calculations will adjust to the chart's bars. You can change the location and colors of the displayed text in the script's settings.

If you need to calculate the ​CAGR between any two points on the chart, see our CAGR Custom Range indicator.



█ FOR Pine Script™ CODERS


Like our Chart VWAP publication, this script calculates on the range of visible bars utilizing the new Pine Script™ functions announced here and the VisibleChart library by PineCoders. It also uses the `cagr()` function from our ta library, which was recently augmented with many new functions.



Look first. Then leap.


Get $15 worth of TradingView Coins for you and a friend: www.tradingview.com/share-your-love/

Read more about the new tools and features we're building for you: www.tradingview.com/blog/en/
Open-source script

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.

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.

Want to use this script on a chart?