Correlation indicator. - page 6

 
Timur1988:

My friends, I would like your opinion. I have written the indicator of correlation according to Pearson in the form of the line between two pairs and in the form of a table of currency pairs, stocks and indices.
1) as a line

m=24 - number of bars for calculating the correlation between pairs
period=D1 - daily chart
price=close - closing prices;
bar=0 - 24 bars by close prices beginning from zero.
In principle, everything is intuitively clear.

2) in the form of a table in the sub-window of the indicator in the main chart window

green - strong positive correlation, coefficient of correlation >=0.8;
light green - positive correlation, coefficient of correlation >=0.6, but <0.8;

red - strong negative correlation, coefficient >=-0.8;

orange - negative, coefficient >=-0.6, but <-0.8;

I would like to hear your opinions on the improvement, the neatness, the presentability, the design of these indicators. What can be added or removed? I will be very grateful!


Hi, the topic is close, so to speak :) ...

1. First of all, the indy needs to see the output of an information notice that the raw data is "synchronised", at least in time, for the same time interval of the financial instrument group used (table of financial instruments). "Synchronisation" ... :) ... time series of quotes without critical omissions of parameters used for the calculation. The bases of quotes themselves are the precursors for the indicator calculations, therefore, the topic is a separate, expensive, etc.

а. In the presence of gaps, and these quite often, otherwise, databases of quotes cost quite a lot, the tables of statistical stability of the indicator for the dynamics of the studied group of financial instruments should be present. The easiest way - a clean "synchronization", if yes, we continue the calculations, otherwise, interrupt the work of the indicator and notify the user that ... of the quotes database - that's up to him :) ...

б. The Pearson coefficient is enough for paired trading technology, at the same time, for the dynamics of groups of financial instruments, the Spearman coefficient or(tau) Kendall's coefficient is necessary. The essence, for example EURUSD D1 time series, God forbid 2005 - 2007, in my opinion, corresponded to a normal distribution,who needs it and how it was obtained, is not important,in all other times, as a rule, time series are not, probably will not be and are not normally distributed.

At any given time, a single value of the correlation coefficient has, by and large, only one meaning - the value of the coefficient is equal to this value. That is all.
Therefore, dynamics of the coefficient is necessary. The indicator trajectory chart is good, of course, but there is practically no useful information. What is needed. Statistics of the indicator trajectory parameters: duration, tangent of the slope angle and so on and so forth. Such parameters are of extraordinary value :). Computing powers are required quite seriously, therefore, a user must be provided with the tables of pre-computed calculations, or these tables must be developed by a user himself. And of course, not in real time. 18 years ago we solved the problem of computing power by constructing "synthetic" financial instruments. Considering that such technology seems to be solved now in MT5, the dynamics of correlations of groups of financial instruments is optimally presented for already constructed "portfolios of assets", or rather for
a cluster of constructed synthetic. This is many times more efficient than paired trading techniques. But, outside of option (...) asset dynamics, not a panacea.

So, what is needed in the indicator itself. It is necessary to output the tables of corresponding statistics of the dynamics of trajectories of the correlation coefficient.

 
Timur1988:

Could you provide a link to the literature?

Neil Record - Currency Dealer Strategies. Currency Overlay.

It's all there about correlations between currency pairs and the financial instruments that determine such correlations. If you need a simpler, but quite understandable approach, I advise you to study the basics of Markowitz portfolio investing. It describes how to select assets based on the principle of negative covariance between them to make the yield-risk curve as smooth as possible. Such approach is acceptable in forex as well, taking into account that it works for long intervals while correlations are suppressed by market noise at short intervals. But for the actual trading do the following: type in YouTube: "Correlation of currency pairs". There are many webinars on the subject, everything is clear and easy to understand.

 
Vjacheslav Lapaev:


Hi! The topic is close, so to speak :) ...

1. First of all, the indy needs to see the output of the information notice that the raw data is "synchronized", at least by time, for the same time interval of the used group of financial instruments (table of financial instruments). "Synchronisation" ... :) ... time series of quotes without critical omissions of parameters used for the calculation. The bases of quotes themselves are the precursors for the indicator calculations, therefore, it is a separate topic, expensive, etc.

а. In the presence of gaps, and these quite often, otherwise, databases of quotes cost quite a lot, the tables of statistical stability of the indicator for the dynamics of the studied group of financial instruments should be present. The easiest way - a clean "synchronization", if yes, we continue the calculations, otherwise, interrupt the work of the indicator and notify the user that ... of the quotes database - that's up to him :) ...

б. The Pearson coefficient is enough for paired trading technology, at the same time, for the dynamics of groups of financial instruments, the Spearman coefficient or(tau) Kendall's coefficient is necessary. The essence, for example EURUSD D1 time series, God forbid 2005 - 2007, in my opinion, corresponded to a normal distribution,who needs it and how it was obtained, is not important,in all other times, as a rule, time series are not, probably will not be and are not normally distributed.

At any given time, a single value of the correlation coefficient has, by and large, only one meaning - the value of the coefficient is equal to this value. That is all.
Therefore, dynamics of the coefficient is necessary. The indicator trajectory chart is good, of course, but there is practically no useful information. What is needed. Statistics of the indicator trajectory parameters: duration, tangent of the slope angle and so on and so forth. Such parameters are of extraordinary value :)
. Computing powers are required quite seriously, therefore, a user must be provided with the tables of pre-computed calculations, or these tables must be developed by a user himself. And of course, not in real time. 18 years ago we solved the problem of computing power by constructing "synthetic" financial instruments. Considering that such technology seems to be solved now in MT5, the dynamics of correlations of groups of financial instruments is optimally presented for already constructed "portfolios of assets", or rather fora cluster of constructed synthetic. This is many times more efficient than paired trading techniques. But, outside of option (...) asset dynamics, not a panacea.

So, what is needed in the indicator itself. It is necessary to output the tables of corresponding Statistical Parameters of the dynamics of the correlation coefficient trajectories.

And what is the value? do you hope that these indicators will be statistically significant?

Or maybe it's just like our previous opponent who prefers to think in paradoxes, proving to himself firstly that he cannot write a bot based on clear patterns, and then he refutes himself with mythical results of "hand trading".

https://www.mql5.com/ru/code/9930

IND_Correlation
IND_Correlation
  • votes: 10
  • 2010.10.05
  • hrenfx
  • www.mql5.com
Индикатор показывает, как менялся коэффициент корреляции (автокорреляции) между двумя фин. инструментами. Входные параметры: Symbol1 - название "ведущего" фин. инструмента из "Обзора рынка". Symbol2 - название "ведомого" фин. инструмента из "Обзора рынка". Depth - глубина выборки (размер скользящего окна) в барах для расчета коэффициента...
 
Sergey Vradiy:

Neil Record - Currency Dealer Strategies. Currency Overlay.

It's all about correlations between currency pairs and the financial instruments that determine those correlations. If you need a simpler, but quite understandable approach, I advise you to study the basics of portfolio investing according to Markowitz. It describes how to select assets based on the principle of negative covariance between them to make the yield-risk curve as smooth as possible. Such approach is acceptable in forex as well, taking into account that it works for long intervals while correlations are suppressed by market noise at short intervals. But for the actual trading do the following: type in YouTube: "Correlation of currency pairs". There are many webinars on the subject, everything is clear and understandable.


Thank you!

 
Probably everyone goes this way and it is useless to prove anything.
Correlation is interesting when assessing the dependence of sheep herd behaviour on weather conditions. This is useful. When estimating time series, however, cointegration is important. Two time series can have correlation = 1 and still be constantly divergent, where is the profit? There is no profit. Moreover, if this is a super strategy that makes all robots lose profits and the hands make them, then it only indicates that there is an external interference and randomness, that is why robots lose profits, because this component of luck is removed.
But to all appearances it is not real to prove anything in this topic, everyone has to make up his own mind.
Although, the strategy is undoubtedly profitable, but it is better to build a pyramid on bonds and the security is higher and the profit will be higher than to trade in a warehouse on currencies, where all currencies are dependent on the quid and there is always some correlation.
 
Alexey Oreshkin:
Probably everyone goes this way and there is no point in proving anything.
Correlation is interesting when assessing the dependence of behavior of a herd of sheep on weather conditions. There is a benefit there. When estimating time series, however, cointegration is important. Two time series can have correlation = 1 and still be constantly divergent, where is the profit? There is no profit. Moreover, if this is a super strategy that makes all robots lose profits and the hands make them, it only indicates that there is an external interference and randomness, that is why robots lose, because this component of luck is removed.
But to all appearances it is not real to prove anything in this topic, everybody has to make up his own mind.
While it is undoubtedly a profitable strategy, but it is better to build a pyramid on bonds - and the reliability is higher and the profit will be higher than to trade with greenhouse currencies, where all currencies are dependent on the quid and there is always some correlation.


Probably everyone goes this way and there is no point in proving anything.

You can easily prove it. Just open a demo for 1000 quid and trade like him (don't be like me, I'm not very articulate). You will make money in any case. If you lose, show me how it's possible, how you can lose it by trading like that.

https://www.youtube.com/watch?v=m2ieQLUwJU8

====================

For some reason everyone is talking about 5% a month)). I do not know why everyone is so obsessed with this five percent.

 
Ibragim Dzhanaev:


You can easily prove it. Just open a demo for 1000 quid and trade like him (don't be like me, I'm not very articulate). You will make money in any case. If you lose, show me how it is possible, how you may lose your money trading.

https://www.youtube.com/watch?v=m2ieQLUwJU8

He trades two spread sizes in the video, not hedging by correlation.

 
Vitaly Muzichenko:

He trades two spread sizes in the video, not hedging by correlation.


Well, at least that's the way it is. There's nothing difficult there.

 
Vitaly Muzichenko:

He trades two spread sizes in the video, not a correlation hedge.


In one of the videos, he says that it is a grail and he does not put stops for lack of need, but the host corrects him - there are no grails, and then he starts putting stops, and generally starts trading differently.

 
Ibragim Dzhanaev:

At least this way. There's nothing difficult there.

How could it not be?

He talks, and mind you, just talks, but he does not trade: Buy EUR/USD and sell USD/Franc.

Why? Why pay 2 spreads, you can just open one euro/franc chart and trade buy and sell there, but this is the most common trading when the moment comes that the locks are no longer collapsible.

He's just misleading people and encouraging them to open an account with them.