Errors, bugs, questions - page 732

 

Here's a question.
In MQL4 the code is like this:

for (i=0;i<limit;i++) 
{
  t=Time[i];
}
Would it be correct in MQL5:
datetime Time[];
ArraySetAsSeries(Time,true);
for (i=0;i<limit;i++) 
{
  CopyTime(_Symbol, _Period, 0, i+1, Time);   
  t=Time[i];
}

 
Vitya:

Here's a question.
The code in MQL4 is like this:

Would it be correct in MQL5:

not quite correct.

it is desirable to call CopyTime once before the loop

Документация по MQL5: Доступ к таймсериям и индикаторам / CopyTime
Документация по MQL5: Доступ к таймсериям и индикаторам / CopyTime
  • www.mql5.com
Доступ к таймсериям и индикаторам / CopyTime - Документация по MQL5
 
sergeev:

not quite correct.

it is desirable to call CopyTime once before the loop

Right?

  datetime Time[];
  ArraySetAsSeries(Time,true);
  CopyTime(_Symbol, _Period, 0, limit, Time);   

  for (i=0;i<limit;i++) 
  {
    t=Time[i];
  }
 

There is a variable Volume in the Data window. As far as I understand it means exchange (real) volume. I noticed today, on EUR/USD M1 (Alpari), if you put the mouse cursor over any bar, you can see volume values. I wonder if anyone knows how these values are calculated? Is this the trading volume on the pair for Alpari clients only, or is it just random numbers at all, or what... In the screenshot below you can see volume = 620m.

 
Alex5757000:

There is a variable Volume in the Data window. As far as I understand it means exchange (real) volume. I noticed today, on EUR/USD M1 (Alpari), if you put the mouse cursor over any bar, you can see volume values. I wonder if anyone knows how these values are calculated? Is this the trading volume on the pair for Alpari clients only, or is it just random numbers at all, or what... In the screenshot below you can see volume = 620m.

Alpari clients only. But the internal volumes of the big offices are highly correlated.
 

Strange glitch while the program is running

int TimeToCycleIndex(datetime lTime, ENUM_TIMEFRAMES lTimeFrame, int lDays)

{

int Resx;

MqlDateTime Struc;

TimeToStruct(lTime,Struc);

Resx=(MarketDayCycle(lTime,lDays)*60*24+Struc.hour*60+Struc.min)/(PeriodSeconds(lTimeFrame)/60);

Print("Resx = ",Resx," ResCalc = ",(MarketDayCycle(lTime,lDays)*60*24+Struc.hour*60+Struc.min)/(PeriodSeconds(lTimeFrame)/60));

return(Resx);

}

Count the same thing several times for comparison, a fragment of the log is shown below. The error is shown in red because it cannot be a negative number. It seems as if a variable is being corrupted. What is this problem related to and how to solve it? Thanks in advance for your help.

array of range '-FreqTime03.mq5'
Resx= -2 ResCalc= 286
Resx= 287 ResCalc= 287
Resx= 0 ResCalc= 0 0
Resx= 1 ResCalc= 1 1
Resx= 2 ResCalc= 2 2
Resx= 3 ResCalc= 3 3
Resx= 3 4 ResCalc= 4 4
Resx= 4 5 ResCalc= 5 5
Resx= 5 6 ResCalc= 6 6
Resx= 7 ResCalc= 7 7
Документация по MQL5: Стандартные константы, перечисления и структуры / Структуры данных / Структура даты
Документация по MQL5: Стандартные константы, перечисления и структуры / Структуры данных / Структура даты
  • www.mql5.com
Стандартные константы, перечисления и структуры / Структуры данных / Структура даты - Документация по MQL5
 
Urain:
Alpari clients only. But the internal volumes of the big offices are very much correlated.
Where is the information from? Al-pari ducas seems to have a supplier - maybe more like their clients?
 

There are classes for building graphical interfaces in the standard library. This is a good thing.

The disappointing thing is that the dialogs are glitchy. It can be observed in the test example. If you double-click and with second click capture a "movable" element (e.g. scrolling bar or window title bar), they can be dragged to any place on the screen. The second frustrating feature is that when a dialog window is moved horizontally, the chart on the chart scrolls together with it. It is not fatal, but unpleasant, especially considering that the purpose of moving is often to look at the chart below the dialog. The third is unstable operation of controls (eg check-boxes) and generally light lags (which probably cannot be fixed in the current implementation of the terminal).

There are also architectural inconveniences (for example, an architecture tuned to static dialog assembling (early linking of elements)), but this is for gourmets. In principle, it is bearable.

There are also pluses and even beauties in the implementation, but about this in this thread is out of the question.

The bugs are fixable.

--

I would also like to have in the standard set of tools to implement multi-page dialogs (CTabBox or something like that).

Документация по MQL5: Стандартная библиотека
Документация по MQL5: Стандартная библиотека
  • www.mql5.com
Стандартная библиотека - Документация по MQL5
 
gal:

Strange glitch while the program is running

int TimeToCycleIndex(datetime lTime, ENUM_TIMEFRAMES lTimeFrame, int lDays)

{

int Resx;

MqlDateTime Struc;

TimeToStruct(lTime,Struc);

Resx=(MarketDayCycle(lTime,lDays)*60*24+Struc.hour*60+Struc.min)/(PeriodSeconds(lTimeFrame)/60);

Print("Resx = ",Resx," ResCalc = ",(MarketDayCycle(lTime,lDays)*60*24+Struc.hour*60+Struc.min)/(PeriodSeconds(lTimeFrame)/60));

return(Resx);

}

Count the same thing several times for comparison, a fragment of the log is shown below. The error is shown in red because it cannot be a negative number. It seems as if a variable is being corrupted. What is this problem related to and how to solve it? Thanks in advance for your help.

1. Please paste the code correctly.

2. Can you give me the full source code, working example or MarketDayCycle function code.

There are no arrays in this piece of code and there is no way to work with arrays

 

when installing the new build 642, the Testing Finished sound does not work after the EA test is completed,

is this a bug or . not a bug ?

Reason: