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!
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.