Questions from Beginners MQL5 MT5 MetaTrader 5 - page 52

 
Thank you!
 
Dimka-novitsek:

Thank you!!! Very understandable.

And here... I don't know, I'm embarrassed to just ask, but still, I'm translating the EA. Is that a complete load of bullshit? Just remove the string?

The text_color variable is declared as type color, it's an unsigned type, its value can never be less than zero.

That's your main mistake.

 
Urain:

The text_color variable is declared as type color, it's an unsigned type, its value can never be less than zero.

That's your main mistake.

Yeah, I didn't write that, I translated it from EmQuele 4, so I'm confused as to what it is. I think maybe color can be compared to a number...

But tell me please, what is it? How this error occurs, from what, where to look in the code??? 2012.10.25 16:29:32 Completely removed print. (EURUSD,M1) cannot load indicator 'Moving Average' [4002]

 
I spent an hour looking for a place in the EA that mentions MA!!! I can't remember... And. There it is. What to look in it? How can this particular error be picked up?
double CalculateStrengthPairsTF(string a_symbol, ENUM_TIMEFRAMES a_timeframe) {

SymbolSelect(
  a_symbol,       // имя символа
  true      // включить или выключить
   );

    long DIGITS_ = SymbolInfoInteger(a_symbol,SYMBOL_DIGITS);
   //---
    MqlTick last_tick;
   SymbolInfoTick(a_symbol,last_tick);
   double BID_ = last_tick.bid;
   BID_ = NormalizeDouble( BID_, (int)DIGITS_);
  
    MA_handle=iMA(a_symbol,periodd(a_timeframe),Period_,0,method_ma,price_applied);
    //--- заполнение массива MA[] текущими значениями индикатора iMA
   //--- в массив будет записано 100 элементов
   
 //--- если не удалось создать хэндл
   if(MA_handle==INVALID_HANDLE)
     {
      //--- сообщим о неудаче и выведем номер ошибки
     PrintFormat("Не удалось создать хэндл индикатора iMA для пары %s/%s, код ошибки %d",
                 a_symbol,
                  EnumToString(a_timeframe),
                  GetLastError()); ResetLastError();return (0.0);} 
                  
                  
 
   
   CopyBuffer(MA_handle,0,0,100,MA);
   //--- задаём порядок индексации массива MA[] как в MQL4
   ArraySetAsSeries(MA,true);  
   double iMA_ = NormalizeDouble(MA[0], (int)DIGITS_);
           
   ATR_handle=iATR(a_symbol,periodd(a_timeframe),Period_   );
   
    //--- если не удалось создать хэндл
   if( ATR_handle==INVALID_HANDLE)
     {
      //--- сообщим о неудаче и выведем номер ошибки
     PrintFormat("Не удалось создать хэндл индикатора iATR для пары %s/%s, код ошибки %d",
                 a_symbol,
                  EnumToString(a_timeframe),
                  GetLastError()); ResetLastError();return (0.0);} 
                  
                  
 
 
I'm going to run the robot again to see in what order the error appears... I.e. ATR doesn't seem to make an error, only MA
 
 
Can you be more specific about which line it is wrong on? Am I looking in the wrong place?
 
Added a print.
double CalculateStrengthPairsTF(string a_symbol, ENUM_TIMEFRAMES a_timeframe) {

   Print("a_symbol  " , a_symbol ,"  a_timeframe ", a_timeframe );
Prints did not give anything to understand!!! What to do?????What?????
 
There are about 1000 places in the EA where the function is called, and honestly I don't understand what could be at least approximately how such an error occurs!!!! What to look for and how to look!!! I'm confused!
 
Dimka-novitsek: What to watch and how to watch!!! I'm confused!
Have you tried looking at the description of the printed error, Dimon Vladimirovich?
Reason: