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.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.