Errors, bugs, questions - page 491

 
Urain:

What do the numbers mean?

And how to get rid of this error ????

By design temp should be equal to -1.0

ZS I have a check for equality to zero, but don't know how to check for equality to this -1.#IND

Look carefully at the examples under Real Types (double, float)
 
Im_hungry:

I agree, but not necessarily on all instruments, just one, because the time is the same everywhere.

The easiest way to determine a new bar: (I made it myself, very simple and effective)

and put the construct in OnTick where you actually need this new bar
Not quite like this. The new bar starts not at 00 sec, but with the arrival of the first tick after 00 sec. If the timeframe does not contain a single tick after 00 sec, we won't have a corresponding bar
 

Good afternoon faced with the following:

Alert("Request = ", Bars("GBPUSD", PERIOD_MN1, datetime("2009.01.01 00:00:00"), datetime("2008.10.01 00:00:00")) );
datetime timeArray[]; //dynamic array, the size is not set
int ckopirovano = CopyTime("GBPUSD", PERIOD_MN1, datetime("2009.01.01 00:00:00"), datetime("2008.10.01 00:00:00"),timeArray);
Alert("Copied = ", ckopirovano);

Resultant :

Query = 4

Copy = 3

Alert("Request = ", Bars("GBPUSD", PERIOD_MN1, datetime("2009.01.01 00:00:00"), datetime("2008.10.01 00:00:00")) );
datetime timeArray[5]; // specify size
int ckopirovano = CopyTime("GBPUSD", PERIOD_MN1, datetime("2009.01.01 00:00:00"), datetime("2008.10.01 00:00:00"),timeArray);
Alert("Copied = ", ckopirovano);

Resultat :

Query = 4

Copied = 4

I mean, I've always copied from timeseries to dynamic array, no size was set (never had an error), and now this. How should I understand it?

Документация по MQL5: Основы языка / Типы данных / Объект динамического массива
Документация по MQL5: Основы языка / Типы данных / Объект динамического массива
  • www.mql5.com
Основы языка / Типы данных / Объект динамического массива - Документация по MQL5
 
Im_hungry:

Give me a harsh argument, I checked on my EA - both on 2 pairs (multic) and

on one the test result since 2000 on all ticks is no different as well as on 1 pair,

and the Expert Advisors with different strategies!


And if the calculation is done not on the text bar but on the history of 2 or more bars (even if it is a million)

We need to search for the bar on history!

So it's not checked well, or the EA is NOT multi-currency, and it just can work with different symbols. The reasoning is simple - we know that ticks come for different symbols at different times. Accordingly, if an EA is onTick EURUSD (for example), and it checks GBPUSD or even just tick changes of GBPUSD instead of EURUSD, the result will be different. In particular, a bar formed on EURUSD may occur before the formation of a bar with the same time on GBPUSD. If you trade GBPUSD twice on the same bar: the previous GBPUSD bar will still be considered as a new bar (zero). As for the multi-currency indicators, everything is clear. Learn the basics.
Построение мультивалютного индикатора с применением множества промежуточных индикаторных буферов
Построение мультивалютного индикатора с применением множества промежуточных индикаторных буферов
  • 2010.05.17
  • Alexey Klenov
  • www.mql5.com
В последнее время возрос интерес к кластерному анализу рынка FOREX. MQL5 открывает новые возможности исследования закономерностей движения валютных пар. Важным преимуществом MQL5, по сравнению с MQL4, является возможность использования неограниченного количества индикаторных буферов. В данной статье описан пример построения мультивалютного индикатора.
 
220Volt:

Good afternoon faced with the following:

Alert("Request = ", Bars("GBPUSD", PERIOD_MN1, datetime("2009.01.01 00:00:00"), datetime("2008.10.01 00:00:00")) );
datetime timeArray[]; //dynamic array, the size is not set
int ckopirovano = CopyTime("GBPUSD", PERIOD_MN1, datetime("2009.01.01 00:00:00"), datetime("2008.10.01 00:00:00"),timeArray);
Alert("Copied = ", ckopirovano);

Resultant :

Query = 4

Copy = 3

Alert("Request = ", Bars("GBPUSD", PERIOD_MN1, datetime("2009.01.01 00:00:00"), datetime("2008.10.01 00:00:00")) );
datetime timeArray[5]; // specify size
int ckopirovano = CopyTime("GBPUSD", PERIOD_MN1, datetime("2009.01.01 00:00:00"), datetime("2008.10.01 00:00:00"),timeArray);
Alert("Copied = ", ckopirovano);

Resultat :

Query = 4

Copied = 4

I mean, I've always copied from timeseries to dynamic array, no size was set (never had an error), and now this. How should I understand it?

There is such a bug, the case is filed in SD. When it will be fixed, I don't know.
 
220Volt:

I mean, I've always copied from timeseries to dynamic array, no size was set (never had an error), and now this. How do you understand all this?

As much was available, so much we got. That's how to understand it. Check the available history depth. Before requesting the data, make sure it is available. What build do you have? recently corrected a bug with copying monthly timeframes, this might be it.
 

Bild 489, I don't think it's about accessibility (because the second option works adequately).

So there's something wrong with it:

Alert("Request = ", Bars("GBPUSD", PERIOD_MN1, datetime("2009.01.01 00:00:00"), datetime("2008.10.01 00:00:00")) );
datetime timeArray[2];
int ckopirovano = CopyTime("GBPUSD", PERIOD_MN1, datetime("2009.01.01 00:00:00"), datetime("2008.10.01 00:00:00"),timeArray);
Alert("Copied = ", ckopirovano);

Resultat :

Query = 4

Copy = 1 (should there be two?)

Документация по MQL5: Стандартные константы, перечисления и структуры / Константы графиков / Периоды графиков
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы графиков / Периоды графиков
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы графиков / Периоды графиков - Документация по MQL5
 

Im_hungry:

I agree, but not necessarily on all instruments, just one, as time is everywhere

the same ...min 00 sec, and the easiest way to detect a new bar: (I've made it myself, it's very simple and effective)

It is obligatory, exactly on all.

One exception - if the EA analyzes only the formed bars, you can just wait for the time of a new bar (:00) and for different instruments analyze the 0th or the 1st bar, depending on whether there is a bar with a new time (if there is - we analyze the old bar with the index 1, and if there is no index - the formed bar will have the index 0, until the new bar appears).

 

Is it a good idea to create a graphical object with a name that is already occupied (to move the whole object with one function)?

If you move one coordinate at a time with ObjecMove, one coordinate may move and another may not.

Документация по MQL5: Стандартные константы, перечисления и структуры / Константы графиков / Типы событий графика
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы графиков / Типы событий графика
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы графиков / Типы событий графика - Документация по MQL5
 
220Volt:

Please tell me, how correct is it to create a graphical object with a name already occupied (to move the whole object with one function)?

It is quite correct, there are no negative consequences in this case.
Reason: