PROTECTED SOURCE SCRIPT
Rolling Compound Return

Rolling Compound Return Indicator - Summary
This indicator calculates and displays the compounded return over rolling time periods, showing how an investment would have performed if held for the specified lookback length.
How it works:
1. Rolling calculation - For each bar, looks back N periods and compounds all the returns together using the formula: (1 + return₁) × (1 + return₂) × ... × (1 + returnₙ) - 1
2. Multiple timeframes - Allows comparison of up to 3 different rolling periods simultaneously:
* Period 1 (default 20 bars): Blue line
* Period 2 (default 50 bars): Orange line
* Period 3 (default 100 bars): Purple line
3. Visual elements:
* Lines plotted as percentage returns on dedicated Y-axis
* Zero reference line to distinguish gains from losses
* Optional green/red fill showing positive/negative zones
* Info table displaying current values for each period
4. Key insight - Unlike simple moving averages of returns, this shows the actual cumulative effect of holding through all the ups and downs over the rolling window.
Use case: Helps identify whether recent price action (over your chosen lookback period) has resulted in net gains or losses, and how different time horizons compare. For example, you might see the 20-period showing +5% while the 50-period shows -2%, indicating recent strength after a longer decline.
The indicator updates on every bar to show the "rolling N-period return" at each point in time.
This indicator calculates and displays the compounded return over rolling time periods, showing how an investment would have performed if held for the specified lookback length.
How it works:
1. Rolling calculation - For each bar, looks back N periods and compounds all the returns together using the formula: (1 + return₁) × (1 + return₂) × ... × (1 + returnₙ) - 1
2. Multiple timeframes - Allows comparison of up to 3 different rolling periods simultaneously:
* Period 1 (default 20 bars): Blue line
* Period 2 (default 50 bars): Orange line
* Period 3 (default 100 bars): Purple line
3. Visual elements:
* Lines plotted as percentage returns on dedicated Y-axis
* Zero reference line to distinguish gains from losses
* Optional green/red fill showing positive/negative zones
* Info table displaying current values for each period
4. Key insight - Unlike simple moving averages of returns, this shows the actual cumulative effect of holding through all the ups and downs over the rolling window.
Use case: Helps identify whether recent price action (over your chosen lookback period) has resulted in net gains or losses, and how different time horizons compare. For example, you might see the 20-period showing +5% while the 50-period shows -2%, indicating recent strength after a longer decline.
The indicator updates on every bar to show the "rolling N-period return" at each point in time.
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 제한 없이 자유롭게 사용할 수 있습니다 — 여기에서 자세히 알아보기.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 제한 없이 자유롭게 사용할 수 있습니다 — 여기에서 자세히 알아보기.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.