OPEN-SOURCE SCRIPT

Cumulative Relative Performance

Purpose:

  • Compares performance between two securities over a specified timeframe
  • Shows relative strength/weakness of one asset versus another


Key Features:

  • Displays cumulative percentage difference in performance
  • Optional smoothing using SMA or EMA
  • Shows ticker symbols in bottom-right corner
  • Can display the difference line between the two securities


In the example screenshot, we use the same point of comparison to show the relative out-performance of SPY vs VUSA (both S&P 500 ETFs) at different points in time.
pairtradingrelativeperformanceRelative Strength ComparisonTrend Analysis

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Disclaimer: Not a financial professional or financial advisor. Any and all publications are opinion and not investment advice.

Disclaimer