Great, I was just going to code a linear regression myself.
However, I found to mistakes in the code, but they'll only become obvious when looking at the slope.
I changed the regression iteration to:
for (i=0; i<=per-1; i++) {
x = per - i;
This first line was modified to get display rSquare at the correct bar
The second modification is a correction for the fact that MT4 counts the bars back. In the original code X1 is linked to Yn etc. But this only affects the slope calculation
However, I found to mistakes in the code, but they'll only become obvious when looking at the slope.
I changed the regression iteration to:
for (i=0; i<=per-1; i++) {
x = per - i;
This first line was modified to get display rSquare at the correct bar
The second modification is a correction for the fact that MT4 counts the bars back. In the original code X1 is linked to Yn etc. But this only affects the slope calculation
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
R - Squared indicator:
Author: onur sirek