OPEN-SOURCE SCRIPT
Omega Ratio Analysis

The Omega ratio was introduced by Keating and Shadwick in 2002 as a superior alternative to the Sharpe ratio.
Sharpe assumes normally distributed returns (ignores fat tails and might be unrealistic sometimes), Omega captures the entire return distribution. This makes it ideal for analyzing crypto, leveraged ETFs, and any assets with asymmetric returns or fat tails (I love fat tails, as part of my investment strategy of course).
Quant funds prefer Omega because it answers:
"How much do I gain above my threshold versus how much do I lose below it?"
This aligns with actual investment goals better than abstract volatility penalties.
THE MATH
Omega ratio is defined as:
Ω(MAR) = (Sum of returns above MAR) / (Sum of returns below MAR)
Where MAR (Minimum Acceptable Return) is your return threshold.
The indicator calculates this using log returns
for better statistical properties:
Time Series Mode
Tracks Omega over time using a rolling window (default 252 bars). Shows color-coded performance zones: Excellent (>1.5), Good (>1.0), Caution (>0.7), Poor (<0.7). Set your annual return target and the indicator converts it to per-bar threshold. Monitor whether you're beating your goal over time.
Omega Curve Mode
It plots Omega versus different MAR thresholds to reveal the return distribution shape. A steep declining curve indicates normal distribution with thin tails. A gentle slope indicates fat tails with asymmetric upside. Compare your asset against any benchmark (default QQQ) to see which has better tail performance at different return thresholds.
HOW TO USE
For Long-Term Investors:
Use 252-bar lookback on daily charts (1 year) or use even weekly charts. Set your annual target around 10% (historical market average). If Omega stays above 1.0, you're beating your goal. Check the curve periodically - a gentle slope means the asset has upside potential beyond average returns.
For Comparing Assets:
Plot two assets (like SPY vs TQQQ). If the leveraged version has a gentler curve slope, it captures more explosive upside days. The crossover point shows which MAR threshold favors which asset. Asset above benchmark at high MAR levels = better for aggressive return goals.
For Regime Detection:
Use shorter periods (60-90 bars) for curve calculation. When curves become steeper, returns are normalizing and momentum may be fading. When curves flatten or become more convex, fat tails are developing (bullish regime forming).
APPLICATIONS
PRACTICAL TIPS
My indicator is perfect for quant investors who want institutional-grade risk analysis. Goes beyond simple volatility metrics to reveal the true shape of return distributions.
PRACTICAL EXAMPLE:

This chart compares SPY versus TQQQ (3x leveraged Nasdaq ETF) on monthly bars over 252 months (21 years), spanning the 2008 crisis, 2020 crash, and multiple market cycles.
Both start at Omega = 1.50 (identical overall risk-adjusted returns), but the curve shapes reveal how those returns were achieved:
SPY (in cyan): Steep drop from 1.5 to near zero by MAR = 1.7% per month. Returns cluster tightly around average - predictable but limited upside.
TQQQ (in red): Gradual slope maintaining Omega = 0.35 even at MAR = 8.7% per month. Shows fat right tail with many explosive +20-40% months that SPY never sees.
Key insight is: For aggressive goals (20-30% annual), SPY's Omega drops to 0.5 (losses dominate) while TQQQ stays above 1.0 (gains exceed losses). TQQQ offers better odds at high return targets, but requires surviving -60 to -90% bear market drawdowns.
This demonstrates how curves reveal distribution characteristics that price charts or Sharpe ratios miss - specifically the asymmetric upside advantage of leveraged products for long-term holders with high risk tolerance.
Let me know if you have questions or suggestions:
- Henrique Centieiro
Sharpe assumes normally distributed returns (ignores fat tails and might be unrealistic sometimes), Omega captures the entire return distribution. This makes it ideal for analyzing crypto, leveraged ETFs, and any assets with asymmetric returns or fat tails (I love fat tails, as part of my investment strategy of course).
Quant funds prefer Omega because it answers:
"How much do I gain above my threshold versus how much do I lose below it?"
This aligns with actual investment goals better than abstract volatility penalties.
THE MATH
Omega ratio is defined as:
Ω(MAR) = (Sum of returns above MAR) / (Sum of returns below MAR)
Where MAR (Minimum Acceptable Return) is your return threshold.
The indicator calculates this using log returns
for better statistical properties:
- Log returns: ln(price / previous price)
- For time series mode: Loops through lookback period, summing gains above threshold and losses below threshold
- For curve mode: Calculates Omega at multiple MAR levels (from 0% to max) to reveal distribution shape
- Values above 1.0 indicate gains exceed losses. For example, Ω = 1.5 means $1.50 in gains for every $1.00 in losses relative to your target.
Time Series Mode
Tracks Omega over time using a rolling window (default 252 bars). Shows color-coded performance zones: Excellent (>1.5), Good (>1.0), Caution (>0.7), Poor (<0.7). Set your annual return target and the indicator converts it to per-bar threshold. Monitor whether you're beating your goal over time.
Omega Curve Mode
It plots Omega versus different MAR thresholds to reveal the return distribution shape. A steep declining curve indicates normal distribution with thin tails. A gentle slope indicates fat tails with asymmetric upside. Compare your asset against any benchmark (default QQQ) to see which has better tail performance at different return thresholds.
HOW TO USE
For Long-Term Investors:
Use 252-bar lookback on daily charts (1 year) or use even weekly charts. Set your annual target around 10% (historical market average). If Omega stays above 1.0, you're beating your goal. Check the curve periodically - a gentle slope means the asset has upside potential beyond average returns.
For Comparing Assets:
Plot two assets (like SPY vs TQQQ). If the leveraged version has a gentler curve slope, it captures more explosive upside days. The crossover point shows which MAR threshold favors which asset. Asset above benchmark at high MAR levels = better for aggressive return goals.
For Regime Detection:
Use shorter periods (60-90 bars) for curve calculation. When curves become steeper, returns are normalizing and momentum may be fading. When curves flatten or become more convex, fat tails are developing (bullish regime forming).
APPLICATIONS
- Asset Selection: Screen for asymmetric opportunities by comparing curve shapes. Gentle slopes indicate lottery-ticket upside potential.
- Leverage Analysis: Quantify whether leveraged ETFs justify the volatility by comparing curves at high MAR levels. If 3x ETF curve significantly above 1x at MAR = 2%, leverage premium exists.
- Risk Assessment: Steep curves = predictable, capped returns. Gentle curves = volatile but moonshot potential. Choose based on your risk tolerance and return goals.
- Performance vs Benchmark: Compare your holdings against sector ETFs or market indices. If your curve is below benchmark at your target MAR, you're not getting paid for the extra risk.
PRACTICAL TIPS
- Curve Period: Use 60-90 bars to see asymmetry during volatile markets. Longer periods (252-1000 bars) average out cycles and produce linear curves.
- MAR Increments: Keep at 50 for smooth curves. Only lower for performance reasons.
- Multi-Symbol Analysis: Compare growth stocks vs QQQ, value vs SPY, crypto vs BTC, or leveraged vs unleveraged to quantify relative risk-reward.
- Reading the X-Axis: MAR shows per-bar percentage. On daily charts, 0.5% MAR means "only days with +0.5%+ returns count as wins." On monthly charts, 3% MAR means "only months with +3%+ returns count as wins."
My indicator is perfect for quant investors who want institutional-grade risk analysis. Goes beyond simple volatility metrics to reveal the true shape of return distributions.
PRACTICAL EXAMPLE:
This chart compares SPY versus TQQQ (3x leveraged Nasdaq ETF) on monthly bars over 252 months (21 years), spanning the 2008 crisis, 2020 crash, and multiple market cycles.
Both start at Omega = 1.50 (identical overall risk-adjusted returns), but the curve shapes reveal how those returns were achieved:
SPY (in cyan): Steep drop from 1.5 to near zero by MAR = 1.7% per month. Returns cluster tightly around average - predictable but limited upside.
TQQQ (in red): Gradual slope maintaining Omega = 0.35 even at MAR = 8.7% per month. Shows fat right tail with many explosive +20-40% months that SPY never sees.
Key insight is: For aggressive goals (20-30% annual), SPY's Omega drops to 0.5 (losses dominate) while TQQQ stays above 1.0 (gains exceed losses). TQQQ offers better odds at high return targets, but requires surviving -60 to -90% bear market drawdowns.
This demonstrates how curves reveal distribution characteristics that price charts or Sharpe ratios miss - specifically the asymmetric upside advantage of leveraged products for long-term holders with high risk tolerance.
Let me know if you have questions or suggestions:
- Henrique Centieiro
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Hedge Fund Manager at Maverick Capital | Wealth Educator | 20+ yrs investing | Stocks, ETFs & Crypto alerts | Join Henrique Wealth Academy for trade alerts & indicators → skool.com/be-limitless/
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Hedge Fund Manager at Maverick Capital | Wealth Educator | 20+ yrs investing | Stocks, ETFs & Crypto alerts | Join Henrique Wealth Academy for trade alerts & indicators → skool.com/be-limitless/
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.