Sortino Ratio -> The NeW System

Calculate and visualize an annualized, smoothed Sortino Ratio that focuses on downside volatility.
What is the Sortino Ratio? 🤔
The Sortino Ratio is a risk-adjusted performance metric like the Sharpe Ratio, but it only penalizes returns below a chosen benchmark (usually the risk-free rate). By isolating “bad” volatility—periods when your returns dip under that minimum—it shows you how well an asset rewards you for downside risk alone. 📉
Indicator Inputs ⚙️
Source 📊: the price series to calculate returns from (e.g. close price).
Calculation Period 📆: the number of days/bars used to compute average returns and downside volatility. Longer periods smooth out noise; shorter periods react faster.
Annual Risk-Free Rate (%) 💰: the minimum acceptable yearly return, converted internally to a per-bar rate. In crypto, you might set this to zero.
Smoothing Period (EMA) 🔄: how many periods to apply an exponential moving average to the raw Sortino Ratio, reducing spikes and making trends clearer.
Strong Threshold 🟢: above this level the line turns green, signaling robust downside-risk-adjusted performance.
Weak Threshold 🔴: below this level the line turns red, warning of underperformance relative to downside risk.
How the Indicator Works 🧮
Compute periodic returns by comparing each bar’s price to the prior bar.
Convert annual risk-free rate to a per-bar rate (divide by 365 for daily bars).
Calculate average return over the chosen period.
Measure downside deviation by squaring only the shortfalls below the risk-free rate, averaging them, and then taking the square root.
Form the raw Sortino Ratio by subtracting the per-bar risk-free rate from the average return, dividing by downside deviation, and annualizing. If downside deviation is zero, it defaults to zero to avoid errors.
Smooth with EMA to filter noise and highlight the underlying trend.
Plot & Interpretation 🎨
Line Color
🟢 Green when the smoothed Sortino Ratio ≥ Strong Threshold (strong downside-risk-adjusted returns).
🔴 Red when ≤ Weak Threshold (weak or negative performance).
⚪ Gray between thresholds (neutral zone).
Threshold Lines
Dashed green line at the Strong Threshold.
Dashed red line at the Weak Threshold.
Pro Tips 💡
A Sortino Ratio around 1 means returns match downside risk on a 1:1 basis—generally acceptable -> Long Term.
Below 0 indicates returns haven’t beaten your minimum acceptable rate.
Above 2 signals excellent downside-risk-adjusted performance—even in volatile markets like crypto, values slightly below 2 can still be strong -> Long Term.
Use this system to spot when an asset’s returns aren’t just high, but safely high—helping you trade with confidence and minimize nasty drawdowns! 🎯
Skrip jemputan sahaja
Hanya pengguna yang diberikan kebenaran oleh penulis mempunyai akses kepada skrip ini dan ini selalunya memerlukan pembayaran. Anda boleh menambahkan skrip kepada kegemaran anda tetapi anda hanya boleh menggunakannya selepas meminta kebenaran dan mendapatkannya daripada penulis — ketarhui lebih lanjut di sini. Untuk lebih butiran, ikuti arahan penulis di bawah atau hubungi LiquidityTrckr secara terus.
TradingView tidak menyarankan pembayaran untuk atau menggunakan skrip kecuali anda benar-benar mempercayai penulisnya dan memahami bagaimana ia berfungsi. Anda juga boleh mendapatkan alternatif sumber terbuka lain yang percuma dalam skrip komuniti kami.
Arahan penulis
Amaran: sila baca panduan kami untuk skrip jemputan sahaja sebelum memohon akses.
Penafian
Skrip jemputan sahaja
Hanya pengguna yang diberikan kebenaran oleh penulis mempunyai akses kepada skrip ini dan ini selalunya memerlukan pembayaran. Anda boleh menambahkan skrip kepada kegemaran anda tetapi anda hanya boleh menggunakannya selepas meminta kebenaran dan mendapatkannya daripada penulis — ketarhui lebih lanjut di sini. Untuk lebih butiran, ikuti arahan penulis di bawah atau hubungi LiquidityTrckr secara terus.
TradingView tidak menyarankan pembayaran untuk atau menggunakan skrip kecuali anda benar-benar mempercayai penulisnya dan memahami bagaimana ia berfungsi. Anda juga boleh mendapatkan alternatif sumber terbuka lain yang percuma dalam skrip komuniti kami.
Arahan penulis
Amaran: sila baca panduan kami untuk skrip jemputan sahaja sebelum memohon akses.