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. 🛡️
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้มันเป็นโอเพ่นซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันการทำงานของสคริปต์ได้ ขอแสดงความชื่นชมผู้เขียน! แม้ว่าคุณจะสามารถใช้งานได้ฟรี แต่อย่าลืมว่าการเผยแพร่โค้ดซ้ำนั้นจะต้องเป็นไปตามกฎระเบียบการใช้งานของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้มันเป็นโอเพ่นซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันการทำงานของสคริปต์ได้ ขอแสดงความชื่นชมผู้เขียน! แม้ว่าคุณจะสามารถใช้งานได้ฟรี แต่อย่าลืมว่าการเผยแพร่โค้ดซ้ำนั้นจะต้องเป็นไปตามกฎระเบียบการใช้งานของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน