OPEN-SOURCE SCRIPT
Log Return Distribution

This indicator calculates the statistical distribution of logarithmic returns over a user-defined lookback period and visualizes it as a horizontal profile anchored to the most recent opening price.
- Lookback Length: The number of recent bars to include in the distribution analysis. A larger value (e.g., 252) provides a long-term statistical view, while a smaller value (e.g., 20) focuses on recent, short-term volatility.
- Bins Count: The number of price levels to divide the distribution into. An odd number is recommended (e.g., 31, 51) to ensure a dedicated central line for the 0% return.
- Max Line Length: The horizontal length (in bars) of the line representing the most frequent return bin (the mode). This setting scales the entire profile, allowing you to make differences in frequency more or less pronounced visually.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。