OPEN-SOURCE SCRIPT
Cập nhật DCA + DRIP Simulator [WynTrader]

DCA + DRIP Simulator [WynTrader]
Hello my friend
This tool simulates real effect of an investment plan when a disciplined DCA+DRIP strategy compounds growth, compared to simply investing and pocketing the dividends. It applies to all kind of security with or without dividend paid, so you can compare what tickers you want..
This isn't a simplified estimate. It reads real price, dividend, and split data directly from TradingView — bar by bar, month by month — and reconstructs what a real investor would have experienced. Apply it to any security — dividend-paying or not, stock, ETF, closed-end fund — and see the picture side by side: with DRIP and no DRIP.
█ CONCEPTS
This indicator illustrates clearly that DCA+DRIP can build more wealth over time than a standard monthly investment approach where dividends are simply cashed out with no plan in mind.
— Dollar Cost Averaging (DCA) means investing a consistent amount every single month, no matter what the market does. When prices drop, your money buys more shares automatically. Over time, this discipline lowers your average cost and keeps emotion out of the equation.
— Dividend Re-Investment Plan (DRIP) means every dividend payment goes straight back into buying more shares, instead of sitting idle. Those extra shares generate their own dividends, which buy more shares — a compounding effect that grows the longer you stay invested.
Together, DCA + DRIP compound together over time.
█ HOW IT WORKS
Set your chart to MONTHLY intervals, else the table is set to zero.
Once configured, the indicator reads price, dividend, and split data directly from TradingView and simulates what a real investor would have experienced: buying every month (DCA), collecting dividends, reinvesting them automatically (DRIP) and adjust data with Splits.
█ FEATURES
Configurable DCA Parameters
Set your initial deposit, monthly contribution, and an optional annual DCA increase (e.g. +5%/yr to reflect salary growth and inflation over time). A withholding tax rate can also be applied for US-listed securities (e.g. 15% for ZQQ).
Flexible Date Range
The simulation runs from your chosen: a) Number of years to date; b) Start date to date; c) Visible chart from Start/End dates of your chart screen.
Side-by-Side Comparison
Every result is shown in two columns simultaneously — With DRIP and No DRIP. Capital, monthly dividend income, total dividends received, net gain, and share count — all at a glance.
Fully Customizable Table Display
Position, text size, and all colors are adjustable directly from the settings panel, so the table fits cleanly on any chart layout.
█ CONCLUSION
Load this indicator on any security — stock, ETF, closed-end fund, with or without dividends. DCA+DRIP Simulator applies to all of them, though DRIP's effect is most visible on dividend-paying securities, where reinvested dividends compound over time.
The difference between With DRIP and No DRIP can be significant over time.
█ WynTrader
I am not a Pine Script programmer — I am an investor who builds tools to support my own analysis, and maybe helps others. A few anomalies may have slipped through and there is likely room for improvement.
Hope you find this little tool useful. Enjoy!
WynTrader
Hello my friend
This tool simulates real effect of an investment plan when a disciplined DCA+DRIP strategy compounds growth, compared to simply investing and pocketing the dividends. It applies to all kind of security with or without dividend paid, so you can compare what tickers you want..
This isn't a simplified estimate. It reads real price, dividend, and split data directly from TradingView — bar by bar, month by month — and reconstructs what a real investor would have experienced. Apply it to any security — dividend-paying or not, stock, ETF, closed-end fund — and see the picture side by side: with DRIP and no DRIP.
█ CONCEPTS
This indicator illustrates clearly that DCA+DRIP can build more wealth over time than a standard monthly investment approach where dividends are simply cashed out with no plan in mind.
— Dollar Cost Averaging (DCA) means investing a consistent amount every single month, no matter what the market does. When prices drop, your money buys more shares automatically. Over time, this discipline lowers your average cost and keeps emotion out of the equation.
— Dividend Re-Investment Plan (DRIP) means every dividend payment goes straight back into buying more shares, instead of sitting idle. Those extra shares generate their own dividends, which buy more shares — a compounding effect that grows the longer you stay invested.
Together, DCA + DRIP compound together over time.
█ HOW IT WORKS
Set your chart to MONTHLY intervals, else the table is set to zero.
Once configured, the indicator reads price, dividend, and split data directly from TradingView and simulates what a real investor would have experienced: buying every month (DCA), collecting dividends, reinvesting them automatically (DRIP) and adjust data with Splits.
█ FEATURES
Configurable DCA Parameters
Set your initial deposit, monthly contribution, and an optional annual DCA increase (e.g. +5%/yr to reflect salary growth and inflation over time). A withholding tax rate can also be applied for US-listed securities (e.g. 15% for ZQQ).
Flexible Date Range
The simulation runs from your chosen: a) Number of years to date; b) Start date to date; c) Visible chart from Start/End dates of your chart screen.
Side-by-Side Comparison
Every result is shown in two columns simultaneously — With DRIP and No DRIP. Capital, monthly dividend income, total dividends received, net gain, and share count — all at a glance.
Fully Customizable Table Display
Position, text size, and all colors are adjustable directly from the settings panel, so the table fits cleanly on any chart layout.
█ CONCLUSION
Load this indicator on any security — stock, ETF, closed-end fund, with or without dividends. DCA+DRIP Simulator applies to all of them, though DRIP's effect is most visible on dividend-paying securities, where reinvested dividends compound over time.
The difference between With DRIP and No DRIP can be significant over time.
█ WynTrader
I am not a Pine Script programmer — I am an investor who builds tools to support my own analysis, and maybe helps others. A few anomalies may have slipped through and there is likely room for improvement.
Hope you find this little tool useful. Enjoy!
WynTrader
Phát hành các Ghi chú
Some minor adjustments have been made to improve the overall appearance.Phát hành các Ghi chú
- Updating of the Table presentation.- New option choosing "Visible Range" : calculations are made from the Current Chart data as seen on the screen.
Phát hành các Ghi chú
Update - 2026-07-11:Phát hành các Ghi chú
Minor adjustments calculation has been done.Phát hành các Ghi chú
Just made minor adjustment calculation.Phát hành các Ghi chú
Minor adjustments ;- Table defaults set to Middle Center position and Small size
- Start/End dates set to bigger size
- Net Gain Avg/y % = Net Gain $ / Total Invested / Nb-years-month * 100
Phát hành các Ghi chú
UpdateTable results are still calculated using Monthly values exactly as before, even if the chart is set to a smaller interval (Daily or Weekly).
If the chart timeframe is smaller than Daily, the table returns zeros and displays the following message:
"Interval too small — use Daily, Weekly or Monthly"
Phát hành các Ghi chú
Update- Fixed the end-of-period date on D/W/M so it matches the requested duration exactly (e.g. 2016-07 ⇒ 2026-07 for 10 years). No change to Capital, dividend, or % values.
Phát hành các Ghi chú
Update : - Comments have been updated to reflects last changes.
Phát hành các Ghi chú
Update — 2026-07-22Added a new row: Total Divid / Invest % — shows the percentage of all the dividends paid divided by the total amount invested for the present period.
- Reveals exactly how much more dividend income is generated when reinvested through DRIP.
- Can exceed 100% on high-yield names, as dividends alone surpass invested capital.
- C
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
WynTrader
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
WynTrader
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.