In statistics, the Pearson correlation coefficient, also referred to as Pearson’s r, the Pearson product-moment correlation coefficient (PPMCC), is a measure of linearcorrelation between two sets of data. It is the covariance of two variables, divided by the product of their standard deviations; thus it is essentially a normalised measurement of the covariance, such that the result always has a value between −1 and 1. https://en.wikipedia.org/wiki/Pearson_correlation_coefficient
There was a discussion on this topic started here , but the initiator seem to have found the solution, but didn’t post it…
So, I’ll try…
Pearson correlation coefficient
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//ρ (rho) = cov(x, y) / (sd(x) * sd(y)), where cov is covariance, sd(x) is the standard deviation of x, etc.
// cov(x,y) = ((x - E(x) * (y - E(y) ), where E(x) is the Expected Value of x...
// E(x) = average(x), the expected value is the weighted sum of the xi values, with the probabilities pi as the weights. When values of x are equiprobable, then the weighted average turns into the simple average.
While this correlation coefficient R shows the correlation between two variables for the current candle, I wonder if it’s not more appropriate to measure correlation of X (say Close) of candle [P] with another variable, say RSI, of previous candle [P-1]. Meaning that one can nealry predict at least direction of X based on the result of previous candle of Y.
The most difficult now, is to find the most appropriate Y (RSI? Stoch? Volume? or combination of a few variables? calculated on same period than X or different period? )
Please share your thoughts or any improvment you may think of.