Geko, can you please verify what CCFp calculation are you using for the MA? There seems to be a bug based on this post ->
https://www.mql5.com/en/code/9088
Code: Select alldouble ma(string sym, int per, int Mode, int Price, int i)
{
double res = 0;
int k = 1;
int ma_shift = 0;
int tf = 0;
switch(Period())
{
case 1: res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i);
k += 5;
case 5: res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i);
k += 3;
case 15: res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i);
k += 2;
case 30: res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i);
k += 2;
case 60: res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i);
k += 4;
case 240: res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i);
k += 6;
case 1440: res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i);
k += 4;
case 10080: res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i);
k +=4;
case 43200: res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i);
}
return(res);
}
Correct code should be
Code: Select alldouble ma(string sym, int per, int Mode, int Price, int i)
{
double res = 0;
int k = 1;
int ma_shift = 0;
int tf = 0;
switch(Period())
{
case 1: res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i);
k *= 5;
case 5: res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i);
k *= 3;
case 15: res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i);
k *= 2;
case 30: res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i);
k *= 2;
case 60: res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i);
k *= 4;
case 240: res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i);
k *= 6;
case 1440: res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i);
k *= 5;
case 10080: res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i);
k *=4;
case 43200: res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i);
}
return(res);
}