OPEN-SOURCE SCRIPT
Rolling Performance Toolkit (Returns, Correlation and Sharpe)

This script provides a flexible toolkit for evaluating rolling performance metrics between any asset and a benchmark.
Features:
Library-based: Built on a custom utilities library for consistent return and statistics calculations.
Rolling Window Control: Choose the lookback period (in days) to calculate metrics.
Multiple Modes: Toggle between Rolling Returns, Rolling Correlation, and Rolling Sharpe Ratio.
Benchmark Comparison: Compare your selected ticker against a benchmark (default: S&P 500 / SPX), but you can easily switch to any symbol.
Risk-Free Rate Options: Choose from zero, a constant annual % rate, or a proxy symbol (default: US03M – 3-Month Treasury Yield).
Annualized Sharpe: Sharpe ratios are annualized by default (×√252) for intuitive interpretation.
This tool is useful for traders and investors who want to monitor relative performance, diversification benefits, or risk-adjusted returns over time.
Features:
Library-based: Built on a custom utilities library for consistent return and statistics calculations.
Rolling Window Control: Choose the lookback period (in days) to calculate metrics.
Multiple Modes: Toggle between Rolling Returns, Rolling Correlation, and Rolling Sharpe Ratio.
Benchmark Comparison: Compare your selected ticker against a benchmark (default: S&P 500 / SPX), but you can easily switch to any symbol.
Risk-Free Rate Options: Choose from zero, a constant annual % rate, or a proxy symbol (default: US03M – 3-Month Treasury Yield).
Annualized Sharpe: Sharpe ratios are annualized by default (×√252) for intuitive interpretation.
This tool is useful for traders and investors who want to monitor relative performance, diversification benefits, or risk-adjusted returns over time.
Skrypt open-source
W duchu TradingView twórca tego skryptu udostępnił go jako open-source, aby traderzy mogli analizować i weryfikować jego funkcjonalność. Brawo dla autora! Możesz korzystać z niego za darmo, ale pamiętaj, że ponowna publikacja kodu podlega naszym Zasadom Społeczności.
Wyłączenie odpowiedzialności
Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.
Skrypt open-source
W duchu TradingView twórca tego skryptu udostępnił go jako open-source, aby traderzy mogli analizować i weryfikować jego funkcjonalność. Brawo dla autora! Możesz korzystać z niego za darmo, ale pamiętaj, że ponowna publikacja kodu podlega naszym Zasadom Społeczności.
Wyłączenie odpowiedzialności
Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.