Errors, bugs, questions - page 39

 
Reproduced it on another sheet by copying, I'm going to make a request at the service desk.
Общайтесь с разработчиками через Сервисдеск!
Общайтесь с разработчиками через Сервисдеск!
  • www.mql5.com
Ваше сообщение сразу станет доступно нашим отделам тестирования, технической поддержки и разработчикам торговой платформы.
 
alexvd:

Do you remember exactly where DebugBreak() was set?

No way to replicate it yet.

Made a request in servicedesk #18435

I set DebugBreaks before all loops.

 
Urain:

Made a request at servicedesk #18435

Zy DebugBreaks put in before all cycles.

Yes, thank you.

Already did it again.

 
alexvd:

Yes, thank you.

Already did it again.

I added two more compiled versions later, one working and one broken, for some reason their weight differs by almost two times.
 
ddd06:

I would like to know the fate of request#18261 foran indicator call from an EA (the value does not match the indicator).

It would be nice if they responded in some way...

Check your service desk again, please, the problem has been solved
 

I have a question about MACD Sample.

I set an Expert Advisor with SL 50 and TP200 in the Alpari demo.

I opened a position on GBPUSD and after some time the Expert Advisor modified the position and entered into the log the following data

> 2010.07.08 20:01:46 Trades '3037120' : failed modify sell 0.10 GBPUSD sl: 1.51740, tp: 1.49868 -> sl: 1.51740, tp: 1.49868 [Invalid stops]

The question is why SL became disabled? The position seems to have been modified (or at least it was moved to BU before)...

At the same time strategy tester did not swear at all...

PS

File with the settings of the indicator is attached...

 

There is a two-dimensional array maVal[a][b] . How to copy muVal values to [b] as I need to browse the array by [a] and compare [b] values

CopyBuffer(maHandle,0,0,3,maVal); Not suitable. That's a cumbersome code.

   bool Buy_Condition_1=((ma1Val[2]<ma1Val[1]) && (ma1Val[1]<ma1Val[0])||
                         (ma2Val[2]<ma2Val[1]) && (ma2Val[1]<ma2Val[0])||
                         (ma3Val[2]<ma3Val[1]) && (ma3Val[1]<ma3Val[0])||
                         (ma4Val[2]<ma4Val[1]) && (ma4Val[1]<ma4Val[0])||
                         (ma5Val[2]<ma5Val[1]) && (ma5Val[1]<ma5Val[0])); // MA растет
 
Interesting:

sl: 1.51740, tp: 1.49868 -> sl: 1.51740, tp: 1.49868 [Invalid stops]

The question is why SL became disabled? It seems that position was modified (at least it was moved to BU before)...

My journal frowned too, if the modification of the order did not change either SL or TP.
 

We write a simple script:

void OnStart(){
  Alert("-----------------------------------");
  Alert("Period() = ",Period()," минут");
  Alert("------------ ",Symbol()," ------------");
}

We throw it sequentially on different timeframes of the same trading instrument, starting with M1 and going upwards. Result: On the timeframe from M1 to M30 the period is correct:

But on H1 timeframe an absolutely fantastic number is thrown.

The most interesting thing is that H2 timeframe, (as well as subsequent hourly) is not far away from H1 timeframe.


On H1 the period = 16386 , on H2 = 16387, on H3 = 16388 and so on - the numbers differ by the last digit.

I am not interested in the method of getting around this bug, but in fixing the bug itself. I want it to be removed at all.

 
drknn:

We write a simple script:

We throw it sequentially on different timeframes of the same trading instrument, starting with M1 and going upwards. Result: On the timeframe from M1 to M30 the period is correct:

But on timeframe H1 an absolutely fantastic number is thrown out.

The most interesting thing is that H2 timeframe (as well as subsequent hourly timeframes) isn't far away from H1 timeframe.


On H1 the period = 16386 , on H2 = 16387, on H3 = 16388 and so on - the numbers differ by the last digit.

I am not interested in the method of getting around this bug, but in fixing the bug itself. So that it was not there at all.

> I am not interested in a way around this bug, but in fixing the bug itself. I dont want it to be there at all.

Don't think I'm being rude or pushy, but pointing out that this bug you just killed me...

On the essence of the question (suggestions):

This is not MQL4, and Period() doesn't represent the number of seconds/minutes in TF.

To get number of seconds in a period you need to use PeriodSeconds function.


And if you try to express Period as a number, then you will get the numeric value corresponding to the identifier of the period in enumeration ENUM_TIMEFRAMES.


PS

When I need to translate Period in MQL4 format, I use this function:

//Fumction PeriodToMinute
int PeriodToMinute(ENUM_TIMEFRAMES Value)
//Возвращает число секунд в периоде
{
//----------------------------------------------------------------------------//
//Служебные переменные
int Result;
//----------------------------------------------------------------------------//
Result = PeriodSeconds(Value)/60;
//----------------------------------------------------------------------------//
return(Result);
//----------------------------------------------------------------------------//
}

And to avoid unnecessary questions about "periodization", here are two more functions: MinuteToPeriod and PeriodToStr.

//Fumction MinuteToPeriod
ENUM_TIMEFRAMES MinuteToPeriod(int Value)
//Преобразовывает число сикунд в период, возвращаемый как ENUM_TIMEFRAMES
{
//----------------------------------------------------------------------------//
//Work variables / Служебные переменные
ENUM_TIMEFRAMES Result;
//----------------------------------------------------------------------------//
  switch(Value)
  {
  //Перирд текущещего графика
  case   0: return(PERIOD_CURRENT); break;
  //Минуты
  case   1: return(PERIOD_M1);  break;   //1 минута
  case   2: return(PERIOD_M2);  break;   //2 минуты
  case   3: return(PERIOD_M3);  break;   //3 минуты
  case   4: return(PERIOD_M4);  break;   //4 минуты
  case   5: return(PERIOD_M5);  break;   //5 минуты
  case   6: return(PERIOD_M6);  break;   //6 минуты
  case  10: return(PERIOD_M10); break;   //10 минуты
  case  12: return(PERIOD_M12); break;   //12 минуты
  case  15: return(PERIOD_M15); break;   //15 минуты
  case  20: return(PERIOD_M20); break;   //20 минуты
  case  30: return(PERIOD_M30); break;   //30 минуты
  //Часы
  case  60: return(PERIOD_H1); break;    //60 минут  - 1 час
  case 120: return(PERIOD_H2); break;    //120 минут - 2 часа  
  case 180: return(PERIOD_H3); break;    //180 минут - 3 часа
  case 240: return(PERIOD_H4); break;    //240 минут - 4 часа
  case 360: return(PERIOD_H6); break;    //360 минут - 6 часов
  case 480: return(PERIOD_H8); break;    //480 минут - 8 часов
  case 720: return(PERIOD_H12); break;   //720 минут - 12 часов
  //Старшие ТФ
  case 1440: return(PERIOD_D1); break;   //1 день
  case 10080: return(PERIOD_W1); break;  //1 неделя 
  case 43200: return(PERIOD_MN1); break; //1 месяц 
  //Default
  default: return(PERIOD_CURRENT);
  }
//----------------------------------------------------------------------------//
return(Result);
//----------------------------------------------------------------------------//
}
//Function PeriodToStr
string PeriodToStr(ENUM_TIMEFRAMES Value)
//Функция возвращает тексовое представление ТФ (периода)
{
//----------------------------------------------------------------------------//
//Work variables / Служебные переменные
string Result; //Возвращаемое значение
//----------------------------------------------------------------------------//

  switch(Value)
  {
  //Минуты
  case PERIOD_M1:  Result = "M1";  break; //1 минута
  case PERIOD_M2:  Result = "M2";  break; //2 минуты
  case PERIOD_M3:  Result = "M3";  break; //3 минуты  
  case PERIOD_M4:  Result = "M4";  break; //4 минуты    
  case PERIOD_M5:  Result = "M5";  break; //5 минут
  case PERIOD_M6:  Result = "M6";  break; //6 минут
  case PERIOD_M10: Result = "M10"; break; //10 минут
  case PERIOD_M12: Result = "M12"; break; //12 минут
  case PERIOD_M15: Result = "M15"; break; //15 минут
  case PERIOD_M20: Result = "M20"; break; //20 минут
  case PERIOD_M30: Result = "M30"; break; //30 минут
  //Часы
  case PERIOD_H1:  Result = "H1";  break; //60 минут   - 1 час
  case PERIOD_H2:  Result = "H2";  break; //120 минут  - 2 часа
  case PERIOD_H3:  Result = "H3";  break; //180 минут  - 3 часа
  case PERIOD_H4:  Result = "H4";  break; //240 минут  - 4 часа
  case PERIOD_H6:  Result = "H6";  break; //360 минут  - 6 часов  
  case PERIOD_H8:  Result = "H8";  break; //480 минут  - 8 часов
  case PERIOD_H12: Result = "H12"; break; //720 минут  - 12 часов
  //Старшие ТФ
  case PERIOD_D1:  Result = "Day";   break; //День
  case PERIOD_W1:  Result = "Week";  break; //Неделя
  case PERIOD_MN1: Result = "Month"; break; //Месяц
  //Unknown
  default: Result = "Unknown";
  break;
  }
//----------------------------------------------------------------------------//
return(Result);
//----------------------------------------------------------------------------//
}