Skip to content
All library documents

A Multi-Asset Correlation Matrix with Rolling Variance Display

Article TradingView scripts

Summary

This indicator presents a table of pairwise correlations for seven selected symbols, alongside a series labeled PBULL. Users can set the symbols, chart timeframe, input price source, smoothing, and correlation window. Each cell displays the correlation estimate and a variance value for that estimate over a separate window; background colors distinguish positive and negative readings. The matrix is intended to make cross-market relationships and their recent variation visible at a glance.

The code uses security requests for each symbol and computes rolling correlations on smoothed price levels. It offers display controls for table position, text size, and color profile, but includes no empirical evaluation or portfolio results. The calculations describe associations over the selected windows, which can change over time and do not by themselves establish a tradable relationship or hedge ratio. The shown source also uses a lookahead setting for requested symbol series, so users should verify timing behavior before relying on historical readings for research or trading decisions.

Key ideas

  • The table displays pairwise rolling correlations across seven configurable symbols and a PBULL series.
  • Correlation is calculated on a smoothed selected price source over a user-set window.
  • A separate variance window adds a measure of recent variation in each displayed correlation.
  • Color shading distinguishes positive from negative correlation values.
  • The indicator provides no trading or portfolio validation, and its lookahead setting warrants timing checks.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.