OPEN-SOURCE SCRIPT
Jensen Alpha RS

🧠 Jensen Alpha RS (J-Alpha RS)
Jensen Alpha RS is a quantitative performance evaluation tool designed to compare multiple assets against a benchmark using Jensen’s Alpha — a classic risk-adjusted return metric from modern portfolio theory.
It helps identify which assets have outperformed their benchmark on a risk-adjusted basis and ranks them in real time, with optional gating and visual tools. 📊
✨ Key Features
• 🧩 Multi-Asset Comparison: Evaluate up to four assets simultaneously.
• 🔀 Adaptive Benchmarking: TOTALES mode uses CRYPTOCAP:TOTALES (total crypto market cap ex-stablecoins). Dynamic mode automatically selects the strongest benchmark among BTC, ETH, and TOTALES based on rolling momentum.
• 📐 Jensen’s Alpha Calculation: Uses rolling covariance, variance, and beta to estimate α, showing how much each asset outperformed its benchmark.
• 📈 Z-Score & Consistency Metrics: Z-Score highlights statistical deviations in alpha; Consistency % shows how often α has been positive over a chosen window.
• 🚦 Trend & Zero Gates: Optional filters that require assets to be above EMA (trend) and/or have α > 0 for confirmation.
• 🏆 Leaders Board Table: Displays α, Z, Rank, Consistency %, and Gate ✓/✗ for all assets in a clear visual layout.
• 🔔 Dynamic Alerts: Get notified whenever the top alpha leader changes on confirmed (non-repainting) data.
• 🎨 Visual Enhancements: Smooth α with an SMA or color bars by the current top-performing asset.
🧭 Typical Use Cases
• 🔄 Portfolio Rotation & Relative Strength: Identify which assets consistently outperform their benchmark to optimize capital allocation.
• 🧮 Alpha Persistence Analysis: Gauge whether a trend’s performance advantage is statistically sustainable.
• 🌐 Market Regime Insight: Observe how asset leadership rotates as benchmarks shift across market cycles.
⚙️ Inputs Overview
• 📝 Assets (1–4): Select up to four tickers for evaluation.
• 🧭 Benchmark Mode: Choose between static TOTALES or Dynamic auto-selection.
• 📏 Alpha Settings: Adjustable lookback, smoothing, and consistency windows.
• 🚦 Gates: Optional trend and alpha filters to refine results.
• 🖥️ Display: Enable/disable table and customize colors.
• 🔔 Alerts: Toggle notifications on leadership changes.
🔎 Formula Basis
Jensen’s Alpha (α) is estimated as:
α = E[Ra] − β × E[Rb]
where β = Cov(Ra, Rb) / Var(Rb), and Ra/Rb represent asset and benchmark returns, respectively.
A positive α indicates outperformance relative to the risk-adjusted benchmark expectation. ✅
⚠️ Disclaimer
This script is for educational and analytical purposes only.
It is NOT a signal. 🚫📉
It does not constitute financial advice, trading signals, or investment recommendations. 💬
The author is not responsible for any financial losses or trading decisions made based on this indicator. 🙏
Always perform your own analysis and use proper risk management. 🛡️
Jensen Alpha RS is a quantitative performance evaluation tool designed to compare multiple assets against a benchmark using Jensen’s Alpha — a classic risk-adjusted return metric from modern portfolio theory.
It helps identify which assets have outperformed their benchmark on a risk-adjusted basis and ranks them in real time, with optional gating and visual tools. 📊
✨ Key Features
• 🧩 Multi-Asset Comparison: Evaluate up to four assets simultaneously.
• 🔀 Adaptive Benchmarking: TOTALES mode uses CRYPTOCAP:TOTALES (total crypto market cap ex-stablecoins). Dynamic mode automatically selects the strongest benchmark among BTC, ETH, and TOTALES based on rolling momentum.
• 📐 Jensen’s Alpha Calculation: Uses rolling covariance, variance, and beta to estimate α, showing how much each asset outperformed its benchmark.
• 📈 Z-Score & Consistency Metrics: Z-Score highlights statistical deviations in alpha; Consistency % shows how often α has been positive over a chosen window.
• 🚦 Trend & Zero Gates: Optional filters that require assets to be above EMA (trend) and/or have α > 0 for confirmation.
• 🏆 Leaders Board Table: Displays α, Z, Rank, Consistency %, and Gate ✓/✗ for all assets in a clear visual layout.
• 🔔 Dynamic Alerts: Get notified whenever the top alpha leader changes on confirmed (non-repainting) data.
• 🎨 Visual Enhancements: Smooth α with an SMA or color bars by the current top-performing asset.
🧭 Typical Use Cases
• 🔄 Portfolio Rotation & Relative Strength: Identify which assets consistently outperform their benchmark to optimize capital allocation.
• 🧮 Alpha Persistence Analysis: Gauge whether a trend’s performance advantage is statistically sustainable.
• 🌐 Market Regime Insight: Observe how asset leadership rotates as benchmarks shift across market cycles.
⚙️ Inputs Overview
• 📝 Assets (1–4): Select up to four tickers for evaluation.
• 🧭 Benchmark Mode: Choose between static TOTALES or Dynamic auto-selection.
• 📏 Alpha Settings: Adjustable lookback, smoothing, and consistency windows.
• 🚦 Gates: Optional trend and alpha filters to refine results.
• 🖥️ Display: Enable/disable table and customize colors.
• 🔔 Alerts: Toggle notifications on leadership changes.
🔎 Formula Basis
Jensen’s Alpha (α) is estimated as:
α = E[Ra] − β × E[Rb]
where β = Cov(Ra, Rb) / Var(Rb), and Ra/Rb represent asset and benchmark returns, respectively.
A positive α indicates outperformance relative to the risk-adjusted benchmark expectation. ✅
⚠️ Disclaimer
This script is for educational and analytical purposes only.
It is NOT a signal. 🚫📉
It does not constitute financial advice, trading signals, or investment recommendations. 💬
The author is not responsible for any financial losses or trading decisions made based on this indicator. 🙏
Always perform your own analysis and use proper risk management. 🛡️
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.