# What is the correlation in trading?

The correlation measures the strength of the relationship between the two prices. In investing, the most used correlation coefficient is the Pearson coefficient.

This coefficient is based on a complex math formula and the result is a number between -1 and 1. If you get 1 as a result than the two prices you are looking at are 100% correlated. If you get -1 than your two prices are 100% inverse correlated.

In general terms, correlation means that 2 prices are going in the same way; so if one price is going up and the second price is going up for a time period you analyze, the two prices will be correlated to some degree.

# Understanding correlation

## Price direction

Let’s take a very simple example to reflect that correlation is about direction (we are not taking into consideration the other parts of the Pearson formula). To do that, we will take the example of Dow Jones and the S&P500 index. Both of them are representing the US economy so it is obvious that they are correlated to some degree. We will set the analysis period for only 2 days.

We are looking at the daily chart and we are working with close prices.

So, in this case, we will check if DJ and S&P are correlated in one day (on close price relative to the previous close price). The correlation coefficient will have only 2 possible values in this case (1 or -1), based on the direction of one price relative to the other price.

You can see on the price chart I highlighted 3 examples where the correlation coefficient is 1 (perfect correlation) if both prices are going in the same direction in that period (1 day in our case) or -1 (perfect inverse correlation) if the two prices are going in opposite directions.

In this case, the coefficient returns only 1 or -1 because there are only 2 price points in each price series (2 prices for DJ and 2 prices for S&P). This is not how the correlation coefficient should be used, it is just to visualize that direction is an important part of the calculation.

## Analysis period

The correlation coefficient may differ according to the period you set for the math calculation to be made on.

First, I am taking the YTD (year to date) chart and set the PERIOD input for the correlation index to 10 (first chart). The most visible fact to stand out is that right now, today, the 3rd of August we have a correlation coefficient of 0.31… Wow …not saying anything relevant about the 2 symbols we are looking at right?

On the bottom chart I set the PERIOD to 50 aaaand….surprise…the correlation index is 0.86.

SAME DATA, SAME HISTORY. DIFFERENT COEFFICIENT.

There are a lot more details to talk about when trying to understand what the Pearson correlation coefficient is actually telling us but I assume these 2 aspects are enough to make a point about how important it is to deeply understand an indicator.

## Price axis layout

Ok, this one is my favorite. I’ve seen tons of trading strategies on the net regarding how to actually trade based on the Pearson correlation coefficient and the most incredible ( no one should ever trade on that) is the one where you are looking for divergences at price on two overlaid charts and you short (sell) the one on top (the price that is higher) and long (buy) the one below (the price that is lower).

This is totally wrong because the correlation coefficient is not saying that if two prices will diverge they will reconverge in such a way that you will make money buying the lower and selling the higher. No way!

### Auto axis

Most of the charting platforms are overlaying 2 charts in such a way the user cand easily see both of them (properly framing the min and the max price of that particular period).

In the first chart, you can see that on the 24th of July DJ is above S&P.

If you scroll the chart to see more history you can see that on the same day (24th of July) DJ is below S&P.

So, in the first example, you would Sell Dj and Buy S&P but in the 2nd example, with the exact same data, you would have get an opposite trading signal.

### Percentage axis

There would be more sense in comparing the percentage evolution of the two assets. We would check if they are strongly correlated and if we would then trade if the difference between them is passing a certain threshold we set for our trading strategy. In this case, we would assume that if one asset grew more than the other, in the future, the 2 would have the same % evolution, so shorting the higher one and buying the lower one would result in a profit.

This looks so good but it is so WRONG!

Here is why: there nothing in the Pearson correlation coefficient that is saying this. You may get one or more good trades based on this strategy but if you do, it is pure luck.

Why? Because the percentage evolution of two assets overlaid on the same chart can give opposite trading signals because the percentage evolution needs a STARTING point and all the other prices are compared to the prices of that starting point.

So if you modify the starting point you can get opposite trading signals (see charts below).

# Why most people trade it WRONG?

- Because they are not putting enough time and effort to deeply understand it
- Because they are google-ing it and trusts every piece of info, regardless of its source.
- Because they believe in quick, easy and passive profits

# Key takeaways about the Pearson correlation

- A strong correlation (close to 1 or -1) for a certain period of time does NOT mean that in the future if the correlation coefficient drops, you can make profits by selling the higher and buying the lower, regardless of the time axis type.
- Two assets can be strongly correlated but to infinitely move away from each other. In the chart below you can see two series (you can think of them as stock prices) that are diverging and never converging aaaand…surprise (again): the correlation coefficient is 0.99. This is not real data, it is just to prove how the correlation coefficient works.

3. You need to combine statistical analysis with other types of analysis (other technical indicators, fundamentals, news).

4. If you are looking for trading based on correlation, you should definitely think about the actual markets you want to trade on and calculate all your costs (for ex: trading OTC indexes will charge you every night and that might eat-up a good chunk of your potential profits)

To sum up, the Pearson correlation coefficient is a great tool but you need to deeply understand it in order to create a solid trading system around it.

In the end, one tip for you: if you had false expectations regarding the way to trade on correlation you might want to read about cointegration.

Happy trading!