OPEN-SOURCE SCRIPT
Annual Lump Sum: Yearly & Compounded

Annual Lump Sum Investment Analyzer (Yearly vs. Compounded)
Overview
This Pine Script indicator simulates a disciplined "Lump Sum" investing strategy. It calculates the performance of buying a fixed dollar amount (e.g., $10,000) on the very first trading day of every year and holding it indefinitely.
Unlike standard backtesters that only show a total percentage, this tool breaks down performance by "Vintage" (the year of purchase), allowing you to see which specific years contributed most to your wealth.
Key Features
Automated Execution: Automatically detects the first trading bar of every new year to simulate a buy.
Dual-Yield Analysis: The table provides two distinct ways to view returns:
Yearly %: How the market performed specifically during that calendar year (Jan 1 to Dec 31).
Compounded %: The total return of that specific year's investment from the moment it was bought until today.
Live Updates: For the current year, the "End Price" and "Yields" update in real-time with market movements.
Portfolio Summary: Displays your Total Invested Capital vs. Total Current Value at the top of the table.
Table Column Breakdown
The dashboard in the bottom-right corner displays the following:
Year: The vintage year of the investment.
Buy Price: The price of the asset on the first trading day of that year.
End Price: The price on the last trading day of that year (or the current price if the year is still active).
Yearly %: The isolated performance of that specific calendar year. (Green = The market ended the year higher than it started).
Compounded %: The "Diamond Hands" return. This shows how much that specific $10,000 tranche is up (or down) right now relative to the current price.
How to Use
Add the script to your chart.
Crucial: Set your chart timeframe to Daily (D). This ensures the script correctly identifies the first trading day of the year.
Open the Settings (Inputs) to adjust:
Annual Investment Amount: Default is $10,000.
Table Size: Adjust text size (Tiny, Small, Normal, Large).
Max Rows: Limit how many historical years are shown to keep the chart clean.
Use Case
This tool is perfect for investors who want to visualize the power of long-term holding. It allows you to see that even if a specific year had a bad "Yearly Yield" (e.g., buying in 2008), the "Compounded Yield" might still be massive today due to time in the market.
Overview
This Pine Script indicator simulates a disciplined "Lump Sum" investing strategy. It calculates the performance of buying a fixed dollar amount (e.g., $10,000) on the very first trading day of every year and holding it indefinitely.
Unlike standard backtesters that only show a total percentage, this tool breaks down performance by "Vintage" (the year of purchase), allowing you to see which specific years contributed most to your wealth.
Key Features
Automated Execution: Automatically detects the first trading bar of every new year to simulate a buy.
Dual-Yield Analysis: The table provides two distinct ways to view returns:
Yearly %: How the market performed specifically during that calendar year (Jan 1 to Dec 31).
Compounded %: The total return of that specific year's investment from the moment it was bought until today.
Live Updates: For the current year, the "End Price" and "Yields" update in real-time with market movements.
Portfolio Summary: Displays your Total Invested Capital vs. Total Current Value at the top of the table.
Table Column Breakdown
The dashboard in the bottom-right corner displays the following:
Year: The vintage year of the investment.
Buy Price: The price of the asset on the first trading day of that year.
End Price: The price on the last trading day of that year (or the current price if the year is still active).
Yearly %: The isolated performance of that specific calendar year. (Green = The market ended the year higher than it started).
Compounded %: The "Diamond Hands" return. This shows how much that specific $10,000 tranche is up (or down) right now relative to the current price.
How to Use
Add the script to your chart.
Crucial: Set your chart timeframe to Daily (D). This ensures the script correctly identifies the first trading day of the year.
Open the Settings (Inputs) to adjust:
Annual Investment Amount: Default is $10,000.
Table Size: Adjust text size (Tiny, Small, Normal, Large).
Max Rows: Limit how many historical years are shown to keep the chart clean.
Use Case
This tool is perfect for investors who want to visualize the power of long-term holding. It allows you to see that even if a specific year had a bad "Yearly Yield" (e.g., buying in 2008), the "Compounded Yield" might still be massive today due to time in the market.
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.