ZenAndTheArtOfTrading

Correlation Meter

ZenAndTheArtOfTrading Обновлено   
This script calculates the covariance and correlation coefficient between two markets using arrays.

Lookback: How many bars to perform the calculation on.
Source: Price source to calculate the correlation on.
Reference Market: The reference market to compare to the current market.

It's a simple indicator, but very useful for determining how correlated your preferred markets to trade are.

A correlation reading of +1.0 means the markets are perfectly positively correlated, a reading of -1.0 means they are perfectly negatively correlated.

If you're not sure what correlation & covariance are then Google the terms with "Investopedia" added to the end - they have some great definitions and examples.

For traders this can be useful for deciding how much risk to spread across two markets that have a high correlation, or how to hedge existing positions by trading a negatively correlated market.

For investors this can be useful for building a truly diversified portfolio.

If a market has a high positive correlation, the black line will stay above zero most of the time. If a market has a high negative correlation, the black line will stay below zero most of the time.

A market with no or little correlation will bounce between the two or hover around zero most of the time.

The example market above is comparing Apple's weekly price action to the S&P500's over the past 20 weeks. It has a high positive correlation as the black line is above zero most of the time.

Good luck with your trading!
Информация о релизе:
Updated to Pine Script v5

My Resources Hub: theartoftrading.com
FREE YouTube Lessons: rebrand.ly/zyt
FREE Pine Script Basics Course: rebrand.ly/zpsbc
Pine Script MASTERY Course: rebrand.ly/zpsmc
My Indicators & Strategies: rebrand.ly/zmisc
Скрипт с открытым кодом

В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения. Вы можете добавить этот скрипт в избранное и использовать его на графике.

Отказ от ответственности

Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.

Хотите использовать этот скрипт на графике?