OPEN-SOURCE SCRIPT
Sortino Ratio

The Sortino ratio is a variation of the Sharpe ratio that differentiates harmful volatility from total overall volatility using the asset's standard deviation of negative portfolio returns—downside deviation—instead of the total standard deviation of portfolio returns. The Sortino ratio takes an asset or portfolio's return and subtracts the risk-free rate and then divides that amount by the asset's downside deviation. The ratio was named after Frank A. Sortino.
What Can the Sortino Ratio Tell You?
The Sortino ratio is useful for investors, analysts, and portfolio managers to evaluate an investment's return for a given level of bad risk. Since this ratio uses only the downside deviation as its risk measure, it addresses the problem of using total risk, or standard deviation, which is important because upside volatility is beneficial to investors and isn't a factor most investors worry about.
The Difference Between the Sortino Ratio and the Sharpe Ratio
The Sortino ratio improves upon the Sharpe ratio by isolating downside or negative volatility from total volatility by dividing excess return by the downside deviation instead of the total standard deviation of a portfolio or asset.
The Sharpe ratio punishes the investment for good risk, which provides positive returns for investors. However, determining which ratio to use depends on whether the investor wants to focus on total or standard deviation or just downside deviation.
CONCLUSION: THE HIGHER THE RATIO, THE BETTER IT IS.
Note: The default risk-free rate is based on the Malaysian rate. Please change based on your country rate.
Note: The default length is based on 1 year Malaysia trading day (11/6/2020 - 11/6/2021).
Note: Sortino ratio is good for assessing a long-term investment, and thus, please use a longer time frame to get a better risk assessment.
Please let me know if this script contains any mistake. Cheers!
What Can the Sortino Ratio Tell You?
The Sortino ratio is useful for investors, analysts, and portfolio managers to evaluate an investment's return for a given level of bad risk. Since this ratio uses only the downside deviation as its risk measure, it addresses the problem of using total risk, or standard deviation, which is important because upside volatility is beneficial to investors and isn't a factor most investors worry about.
The Difference Between the Sortino Ratio and the Sharpe Ratio
The Sortino ratio improves upon the Sharpe ratio by isolating downside or negative volatility from total volatility by dividing excess return by the downside deviation instead of the total standard deviation of a portfolio or asset.
The Sharpe ratio punishes the investment for good risk, which provides positive returns for investors. However, determining which ratio to use depends on whether the investor wants to focus on total or standard deviation or just downside deviation.
CONCLUSION: THE HIGHER THE RATIO, THE BETTER IT IS.
Note: The default risk-free rate is based on the Malaysian rate. Please change based on your country rate.
Note: The default length is based on 1 year Malaysia trading day (11/6/2020 - 11/6/2021).
Note: Sortino ratio is good for assessing a long-term investment, and thus, please use a longer time frame to get a better risk assessment.
Please let me know if this script contains any mistake. Cheers!
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。