OPEN-SOURCE SCRIPT
Dividends, Returns, and Growth Calculator

**1 / 3 / 5 / 10 Year Returns, Income and Value**
This indicator estimates how a fixed investment would have performed over the past 1, 3, 5, and 10 years.
It combines historical price performance, gross dividend distributions, optional dividend reinvestment, accumulated shares, latest payout income, trailing-12-month dividend yield, and current position value in one compact table.
The script is designed for dividend-paying stocks, ETFs, and funds.
## Main Features
* Calculates 1-year, 3-year, 5-year, and 10-year price returns
* Calculates total return with or without dividend reinvestment
* Simulates whole-share or fractional-share DRIP
* Uses actual historical gross dividend events
* Estimates the delay between dividend events and cash distribution
* Calculates trailing-12-month dividend yield
* Shows the cash generated by the latest completed distribution
* Shows the number of shares currently held
* Shows the current market value of the simulated position
* Automatically estimates monthly, quarterly, semi-annual, or annual payout frequency
* Uses daily data internally, allowing the table to work on intraday and higher-timeframe charts
## Table Columns
### Term
The historical investment period being simulated:
* 1Y
* 3Y
* 5Y
* 10Y
### Start
The historical closing price used to establish the original position.
The initial investment is divided by this price to calculate the original number of shares purchased.
### Price %
The change in share price from the historical starting price to the current price.
Dividends are not included.
### Total %
The total return generated by the investment, including dividends.
The calculation changes depending on whether dividend reinvestment is enabled.
**Reinvest Dividends enabled**
Total return includes:
* The current value of the original shares
* The current value of all shares purchased through DRIP
* Dividends generated by DRIP-acquired shares
* Any remaining whole-share DRIP cash
* Any dividend cash waiting for the estimated distribution date
This represents a compounded total-return simulation.
**Reinvest Dividends disabled**
Total return includes:
* The current value of the original shares
* All dividends received during the selected period
* Any dividend payment that has been earned but is still pending
Dividends are assumed to be withdrawn after each payout. They are still counted as investment return, but they do not purchase additional shares or compound.
### DIV Yld TTM
The trailing-12-month dividend yield.
It is calculated as:
Total gross dividends per share recorded during the last 365 days divided by the current share price.
This calculation uses actual historical dividend events rather than a financial-statement estimate.
Special dividends, payout increases, payout reductions, and irregular distributions may therefore affect the displayed yield.
### Last Payout
The cash generated by all shares held for the latest completed distribution.
The payout is calculated using the number of shares owned when that distribution was earned.
With DRIP enabled, this is the cash received before the payment was reinvested.
With DRIP disabled, it is the cash generated by the original shares.
The displayed prefix represents the estimated distribution frequency:
* M = Monthly
* Q = Quarterly
* S = Semi-Annual
* A = Annual
### Shares
The number of shares currently held in the simulation.
With dividend reinvestment enabled, this includes the original shares and all additional shares purchased through DRIP.
With dividend reinvestment disabled, the share count remains equal to the original shares purchased at the beginning of the selected period.
### Value
The current market value of the shares still held.
With dividend reinvestment disabled, the Value column always shows:
Current shares held multiplied by the current share price.
Previously withdrawn dividends are not added to Value.
With dividend reinvestment enabled, the user can select:
**Total Value**
Includes the current market value of all shares plus remaining and pending dividend cash.
**Stock Value Only**
Includes only the number of shares held multiplied by the current share price.
## Dividend Reinvestment
When dividend reinvestment is enabled, each historical distribution is calculated using the number of shares held at that time.
The resulting dividend cash becomes available on the estimated distribution date and is reinvested using the closing price on that date.
Two DRIP methods are available.
### Whole Shares Only
Only complete shares are purchased.
Unused dividend cash is carried forward until enough cash is available to purchase another full share.
### Fractional Shares
All available dividend cash is reinvested, including fractional shares.
This generally produces a more complete compounding simulation because no cash is left waiting for a whole-share purchase.
## Distribution-Date Estimate
TradingView provides historical dividend events but does not consistently provide the actual historical cash payment date for every symbol.
This script can therefore delay reinvestment until an estimated distribution date.
Automatic defaults are:
* ETFs and funds: 7 calendar days
* Individual stocks: 28 calendar days
The delay can also be disabled or set manually.
When the delay is disabled, dividend cash is treated as available on TradingView’s dividend-event date.
## Important Notes
This indicator is a historical simulation and does not guarantee future performance, income, or dividend growth.
Results depend on the completeness and accuracy of TradingView’s historical price and dividend data.
The simulation does not include:
* Income taxes
* Dividend withholding taxes
* Brokerage commissions
* Foreign-exchange conversion costs
* Bid-and-ask spreads
* Broker-specific DRIP discounts
* Broker-specific reinvestment timing
* Slippage
* Corporate actions not represented correctly in TradingView’s data
Gross dividend values are used.
Actual investor results may differ depending on tax residency, account type, broker policies, currency conversion, and dividend eligibility.
This indicator is intended for research, comparison, and educational purposes only. It is not financial advice.
This indicator estimates how a fixed investment would have performed over the past 1, 3, 5, and 10 years.
It combines historical price performance, gross dividend distributions, optional dividend reinvestment, accumulated shares, latest payout income, trailing-12-month dividend yield, and current position value in one compact table.
The script is designed for dividend-paying stocks, ETFs, and funds.
## Main Features
* Calculates 1-year, 3-year, 5-year, and 10-year price returns
* Calculates total return with or without dividend reinvestment
* Simulates whole-share or fractional-share DRIP
* Uses actual historical gross dividend events
* Estimates the delay between dividend events and cash distribution
* Calculates trailing-12-month dividend yield
* Shows the cash generated by the latest completed distribution
* Shows the number of shares currently held
* Shows the current market value of the simulated position
* Automatically estimates monthly, quarterly, semi-annual, or annual payout frequency
* Uses daily data internally, allowing the table to work on intraday and higher-timeframe charts
## Table Columns
### Term
The historical investment period being simulated:
* 1Y
* 3Y
* 5Y
* 10Y
### Start
The historical closing price used to establish the original position.
The initial investment is divided by this price to calculate the original number of shares purchased.
### Price %
The change in share price from the historical starting price to the current price.
Dividends are not included.
### Total %
The total return generated by the investment, including dividends.
The calculation changes depending on whether dividend reinvestment is enabled.
**Reinvest Dividends enabled**
Total return includes:
* The current value of the original shares
* The current value of all shares purchased through DRIP
* Dividends generated by DRIP-acquired shares
* Any remaining whole-share DRIP cash
* Any dividend cash waiting for the estimated distribution date
This represents a compounded total-return simulation.
**Reinvest Dividends disabled**
Total return includes:
* The current value of the original shares
* All dividends received during the selected period
* Any dividend payment that has been earned but is still pending
Dividends are assumed to be withdrawn after each payout. They are still counted as investment return, but they do not purchase additional shares or compound.
### DIV Yld TTM
The trailing-12-month dividend yield.
It is calculated as:
Total gross dividends per share recorded during the last 365 days divided by the current share price.
This calculation uses actual historical dividend events rather than a financial-statement estimate.
Special dividends, payout increases, payout reductions, and irregular distributions may therefore affect the displayed yield.
### Last Payout
The cash generated by all shares held for the latest completed distribution.
The payout is calculated using the number of shares owned when that distribution was earned.
With DRIP enabled, this is the cash received before the payment was reinvested.
With DRIP disabled, it is the cash generated by the original shares.
The displayed prefix represents the estimated distribution frequency:
* M = Monthly
* Q = Quarterly
* S = Semi-Annual
* A = Annual
### Shares
The number of shares currently held in the simulation.
With dividend reinvestment enabled, this includes the original shares and all additional shares purchased through DRIP.
With dividend reinvestment disabled, the share count remains equal to the original shares purchased at the beginning of the selected period.
### Value
The current market value of the shares still held.
With dividend reinvestment disabled, the Value column always shows:
Current shares held multiplied by the current share price.
Previously withdrawn dividends are not added to Value.
With dividend reinvestment enabled, the user can select:
**Total Value**
Includes the current market value of all shares plus remaining and pending dividend cash.
**Stock Value Only**
Includes only the number of shares held multiplied by the current share price.
## Dividend Reinvestment
When dividend reinvestment is enabled, each historical distribution is calculated using the number of shares held at that time.
The resulting dividend cash becomes available on the estimated distribution date and is reinvested using the closing price on that date.
Two DRIP methods are available.
### Whole Shares Only
Only complete shares are purchased.
Unused dividend cash is carried forward until enough cash is available to purchase another full share.
### Fractional Shares
All available dividend cash is reinvested, including fractional shares.
This generally produces a more complete compounding simulation because no cash is left waiting for a whole-share purchase.
## Distribution-Date Estimate
TradingView provides historical dividend events but does not consistently provide the actual historical cash payment date for every symbol.
This script can therefore delay reinvestment until an estimated distribution date.
Automatic defaults are:
* ETFs and funds: 7 calendar days
* Individual stocks: 28 calendar days
The delay can also be disabled or set manually.
When the delay is disabled, dividend cash is treated as available on TradingView’s dividend-event date.
## Important Notes
This indicator is a historical simulation and does not guarantee future performance, income, or dividend growth.
Results depend on the completeness and accuracy of TradingView’s historical price and dividend data.
The simulation does not include:
* Income taxes
* Dividend withholding taxes
* Brokerage commissions
* Foreign-exchange conversion costs
* Bid-and-ask spreads
* Broker-specific DRIP discounts
* Broker-specific reinvestment timing
* Slippage
* Corporate actions not represented correctly in TradingView’s data
Gross dividend values are used.
Actual investor results may differ depending on tax residency, account type, broker policies, currency conversion, and dividend eligibility.
This indicator is intended for research, comparison, and educational purposes only. It is not financial advice.
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.