Multicurrency advisor based on cluster indicators - page 4

 

I'm more interested in another question. This is the function in the indicator.

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

It looks like the sign was mixed up. It should have been multiplied.

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

And in the last two calculations an error was made.

Why?

 
Vinin >>:

Меня вот больше другой вопрос интересует. Вот эта функция в индикаторе.

Похоже что знак перепутан был. Умножение должно было быть

Да и то в последних двух расчетах ошибка сделана.

Почему?

This question should rather be addressed to Semen Semenych, the author of the indicators, but he has not been heard from or seen for a long time. As far as I understand, the indicators are calculated based on the idea that the sum of lines of all currencies at the moment equals 0. Maybe from these considerations there is addition, not multiplication.

Although visually the difference is obvious


 

Colleagues, I apologise for being off-topic ....


just to clarify:

are there any techniques for testing multi-currency EAs?


Thank you.

 
Morzh09 писал(а) >>

Colleagues, I apologise for being off-topic ....

just to clarify:

are there any techniques for testing multi-currency EAs?

Thank you.

When testing in MT4 there are a number of problems. The main one is not quite correct working with memory. In general, it is not enough. The most reasonable solution is to import quotes (synchronized) into an Expert Advisor and do everything there. Including calculation of indicators.

 
Vinin >>:

При тестирования в МТ4 существует ряд проблем. Основная - не совсем корректная работа с памятью. В общем не хватает. Самое разумное - импортировать котирвки (синхронизированные) в программу анализа и делать все там уже. Включая и расчет индикаторов.

What software analysers can you recommend?

 
evbut писал(а) >>

What software analysers can you recommend?

Usually everyone uses what they know best.

 
Vinin >>:

Меня вот больше другой вопрос интересует. Вот эта функция в индикаторе.

Похоже что знак перепутан был. Умножение должно было быть

Да и то в последних двух расчетах ошибка сделана.

Почему?

Could you tweak the indicator as written here. i.e. add timing and history loading control?

 
evbut писал(а) >>

Could you tweak the indicator as written here. i.e. add timing and history loading control?

I can certainly, or rather make my own analogue. You shouldn't fix someone else's indicator. We must leave it in its author's version.

 
Vinin >>:

Меня вот больше другой вопрос интересует. Вот эта функция в индикаторе.

Похоже что знак перепутан был. Умножение должно было быть

Да и то в последних двух расчетах ошибка сделана.

Почему?

Yeah, that sounds like a mistake. And the days must be multiplied by 5 to get a week.

On the other hand, the author's version "draws prettier", less teeth. Semenych would come here.


USDJPY


 
BLACK_BOX >>:

Семеныча бы сюда.


where to find him :)


Will there be anyone willing to implement TC in code?