Indicators: cluser indicator CC and CCFp updated

 

cluser indicator CC and CCFp updated:

The original cluster CC and CCFP indicators by Simeon Semenych and can be found on from http://articles.mql4.com/484 and this artical also descripted how to use the cluster indicator. This updated version has features below: 1) the indicator refeshed

Author: finimej

 

WELL DONE!!! These were very much needed enhancements!

 
z00gie:

WELL DONE!!! These were very much needed enhancements!



The is error, look at the usdjpy, it is displayed as + 0.0044, but clearly the line for it is negative. Same for usdcad. So 2 errors are being shown.
 
advacement in forex indicator!!
 

Hi, 

Can you please explain why it doesn't give any buffer values for output? Noob here and I use fxdreema for making EA.... Thanks a lot in advance !! 

Files:
p2.mq4  89 kb
 

There's a bug in the code..... see how the values changes when you make 'ShowOnlyPairOnChart' as true. 

Files:
 

There's a bug in the function  ma.

double 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


double 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);
  }       
 
grandaevus:

There's a bug in the function  ma.


Correct code should be


New Updated Code that gives more accurate results

double 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; 
                   k *= 5;
       case 5:     res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i) / k; 
                   k *= 3;
       case 15:    res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i) / k; 
                   k *= 2;
       case 30:    res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i) / k; 
                   k *= 2;
       case 60:    res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i) / k; 
                   k *= 4;
       case 240:   res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i) / k; 
                   k *= 6;
       case 1440:  res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i) / k; 
                   k *= 5;
       case 10080: res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i) / k; 
                   k *=4;
       case 43200: res += iMA(sym, tf, per*k, ma_shift, Mode, Price, i) / k; 
     } 
   return(res);
  }       
 

HI Guy,

Can anyone update the code to include exotic pairs as USDCZK etc.

Thank you

Gerald

 
Is there a way that you could add XAU to the list of majors already in the indicator
Reason: