Questions from Beginners MQL5 MT5 MetaTrader 5 - page 791

 

Возвращаемое значение

The number of copied array elements or -1 in case ofan error.

There is also ArraySize...
 
fxsaber:
There's also ArraySize...

As it happens, I've never encountered an array where not all elements are copied, it either copies all the requested elements, or it doesn't copy and -1

P.S. Ah, I see why you wroteArraySize, I originally wrote it the same way, but then replaced it with Bars for clarity
 
Vitaly Muzichenko:

Thanks, I didn't know about the extended Bars functionality in MT5.

 
Aleksey Vyazmikin:

Thanks, I didn't know about the extended Bars functionality in MT5.

It is now exactly the same in MT4 to your surprise ;)

 
Artyom Trishkin:

It is now exactly the same in MT4 to your surprise ;)


Especially surprising is the fact that there is no mention of this in the MT4 helpdesk.


int Bars

Количество баров на текущем графике.

Пример:

  int counter=1;
  for(int i=1; i<=Bars; i++)
    {
     Print(Close[i-1]);
    }

Смотри также

Функция Bars, iBars




 
Aleksey Vyazmikin:

Especially surprising is the fact that there is no mention of this in the MT4 Help.


int Bars

Количество баров на текущем графике.

Пример:

  int counter=1;
  for(int i=1; i<=Bars; i++)
    {
     Print(Close[i-1]);
    }

Смотри также

Функция Bars, iBars




Alexei, even in your post there is a link with examples and explanations.

int  Bars(
   string           symbol_name,     // имя символа
   ENUM_TIMEFRAMES  timeframe,       // период
   datetime         start_time,      // с какой даты
   datetime         stop_time        // по какую дату
   );
Exactly the same as in mql5
Bars - Доступ к таймсериям и индикаторам - Справочник MQL4
Bars - Доступ к таймсериям и индикаторам - Справочник MQL4
  • docs.mql4.com
Если указаны параметры start_time и stop_time, то функция возвращает количество баров в диапазоне дат. Если эти параметры не указаны, то функция возвращает общее количество баров. Если данные для таймсерии с указанными...
 
Alexey Viktorov:

Alexei, even in your post there is a link with examples and explanations.

Exactly the same as in mql5

So I'm talking about the help in ME!

 
Aleksey Vyazmikin:

So I'm talking about the help in ME!

And in ME, where does the help come from? From the same website where all the links in these posts are from.

 
Alexey Viktorov:

And in ME, where does the help come from? From the same site where all the links in these posts are from.


There's a file there which is updated periodically...

 
Aleksey Vyazmikin:

There's a file that's updated periodically...

And it's all the same


Reason: