OPEN-SOURCE SCRIPT
Rolling 250-Day Sharpe Ratio

This Pine Script indicator, “Rolling 250-Day Sharpe Ratio”, computes the trailing Sharpe Ratio for any traded asset over a 250-session window, equivalent to approximately one trading year. The script first derives daily log returns and adjusts them by subtracting the daily equivalent of the 3-month US Treasury yield to obtain the excess return. It then calculates the rolling mean and standard deviation of these excess returns to produce the annualized Sharpe Ratio, which is displayed as a continuous time series on the chart. This allows traders and analysts to assess how the asset’s risk-adjusted performance evolves over time relative to a risk-free benchmark.
A persistently high Sharpe Ratio can indicate strong risk-adjusted returns, but it is essential to approach extreme values with caution. Elevated Sharpe readings can sometimes reflect unsustainable trends, excessive leverage, or periods of unusually low volatility that may revert abruptly. Conversely, a low or negative Sharpe Ratio does not automatically imply an asset should be avoided; it might signal an opportunity if the risk environment normalizes.
A persistently high Sharpe Ratio can indicate strong risk-adjusted returns, but it is essential to approach extreme values with caution. Elevated Sharpe readings can sometimes reflect unsustainable trends, excessive leverage, or periods of unusually low volatility that may revert abruptly. Conversely, a low or negative Sharpe Ratio does not automatically imply an asset should be avoided; it might signal an opportunity if the risk environment normalizes.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。