//--- correlation coefficient calculation double array_a[]; double array_b[]; vector a; vector b; for(int i=limit; i>=0; i--) { int count=ExtPeriod; if(limit>1 && i+count>limit) count=limit-i+1; if(ArrayCopy(array_a,ExtBufferMA1,0,i,count)!=count || ArrayCopy(array_b,ExtBufferMA2,0,i,count)!=count) continue; a.Swap(array_a); b.Swap(array_b); ExtBufferCorrelation[i]=a.CorrCoef(b); }
I can't understand what the reason is
If you run the indicator on the visual test on the gold futures and compare it with XAUUSD, the indicator line and calculations in the robot are normal.
But if after the test to look at the chart that is displayed according to the results of testing or throw the indicator with the test parameters separately, then these lines are not clear on what criteria make their calculations.
Visual testing
And this appears after the test, the same thing happens if you add an indicator separately.
What can be the problem ?

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
Correlation Coefficient:
Correlation Coefficient" indicator
Author: Artyom Trishkin