LeviathanCapital

Correlation Matrix + Heatmap - By Leviathan

A quick and easy way to visualize the correlation between 10 different symbols over a custom period of time, in the form of a matrix with a heatmap visualization and additional tools such as price increase/decrease %, multi-timeframe function, customizable appearance and more.

The indicator displays correlation coefficients for each pair of 10 assets in a matrix format, where the rows and columns represent the assets being compared between each other. The color of each cell corresponds with the strength of the correlation coefficient, allowing you to quickly identify which assets are strongly correlated, and which are not, and use that information to adjust risk or even get trade ideas. Coupled with the "Price Change" function, the script will help you find trade opportunities based on eg. the long-term correlation strength and short-term price direction differences between two assets. The "Correlation Length" input defines the number of bars used for calculating the correlation, while "Price Change Length" defines the bar to which the current price is compared when calculating price change (eg. the input 20 means that the script will compare the price of the candle close that occurred 20 bars ago and the current price).

Correlation coefficient:
The correlation coefficient is a statistical measure that quantifies the degree of linear relationship between two variables. The correlation coefficient ranges from -1 to 1, with 1 being perfect positive correlation and -1 being perfect negative correlation.

• A correlation coefficient of 1 indicates a perfect positive linear relationship between two variables. This means that when one variable increases, the other variable also increases in a proportional manner.
• A correlation coefficient of 0 indicates no linear relationship between two variables. This means that changes in one variable do not affect the other variable.
• A correlation coefficient of -1 indicates a perfect negative linear relationship between two variables. This means that when one variable increases, the other variable decreases in a proportional manner.

Inspired by @RicardoSantos's script

Register to support free indicators:
BYBIT: partner.bybit.com/b/Leviathan
WOO X: referral.woo.org/7MY2
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?