OPEN-SOURCE SCRIPT
Updated

Relative Performance Suite

391
Overview

The Relative Performance Suite (RPS) is a versatile and comprehensive indicator designed to evaluate an asset's performance relative to a benchmark. By offering multiple methods to measure performance, including Relative Performance, Alpha, and Price Ratio, this tool helps traders and investors assess asset strength, resilience, and overall behavior in different market conditions.

Key Features:

✅ Multiple Performance Measures:
Choose from various relative performance calculations, including:

Relative Performance:
Measures how much an asset has outperformed or underperformed its benchmark over a given period.

Relative Performance (Proportional):
A proportional version of relative performance,
factoring in scaling effects.

Relative Performance (MA Based):
Uses moving averages to smooth performance fluctuations.

Alpha:
A measure of an asset’s performance relative to what would be expected based on its beta and the benchmark’s return. It represents the excess return above the risk-free rate after adjusting for market risk.

Price Ratio:
Compares asset prices directly to determine relative value over time.

✅ Customizable Moving Averages:
Apply different moving average types (SMA, EMA, SMMA, WMA, VWMA) to smooth price inputs and refine calculations.

✅ Beta Calculation:
Includes a Beta measure used in Alpha calculation, which users can toggle the visibility of helping users understand an asset's sensitivity to market movements.

✅ Risk-Free Rate Adjustment:
Incorporate risk-free rates (e.g., US Treasury yields, Fed Funds Rate) for a more accurate calculation of Alpha.

✅ Logarithmic Returns Option:
Users can switch between standard returns and log returns for more refined performance analysis.

✅ Dynamic Color Coding:
Identify outperformance or underperformance with intuitive color coding.
Option to color bars based on relative strength, making chart analysis easier.

✅ Customizable Tables for Data Display:
Overview table summarizing key metrics.
Explanation table offering insights into how values are derived.

How to Use:

Select a Benchmark: Choose a comparison symbol (e.g., TOTAL or SPX ).
Pick a Performance Metric: Use different modes to analyze relative performance.
Customize Calculation Methods: Adjust moving averages, timeframes, and log returns based on preference.
Interpret the Colors & Tables: Utilize the dynamic coloring and tables to quickly assess market conditions.

Ideal For:

Traders looking to compare individual asset performance against an index or benchmark.
Investors analyzing Alpha & Beta to understand risk-adjusted returns.
Market analysts who want a visually intuitive and data-rich performance tracking tool.

This indicator provides a powerful and flexible way to track relative asset strength, helping users make more informed trading decisions.
Release Notes
Fixed Wrong MA being used in color coding.
Release Notes
Fixed Table text and coloring
Release Notes
Removed Relative Performance (Proportional) option as logic was flawed so it was just a worse version of Relative Performance.
Added an option to normalize Relative Performance by the ratio of Benchmark ATR% to Asset ATR%. This adjustment accounts for differences in volatility, allowing for a fairer comparison of relative performance. The goal is to identify assets with the highest potential returns when using a fixed-risk leveraged position-sizing approach.
Updated to Pinescript V6

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.