Errors, bugs, questions - page 760

 
Karlson:

It seems to me, that bars of older TF rarely "disappear".

Another variant is to obtain the time of this bar simultaneously through CopyTime().

And third option (probably easiest) use CopyRates in structure at once.

Thank you... The matter is that I work with M1 and often see asynchronous bars with the same index on different symbols. Comparing dates is also an option. I will see, which variant is better for calculation speed...
 
Alex5757000:
Thank you... The thing is, I work on M1 and often see asynchronous bars with the same index on different instruments. Comparing dates is also an option. I will look at what variant is more optimal in terms of computing speed.
There is something about synchronization here.
 
Lizar:
There is something about synchronisation here.

Thank you! Useful article... That is, for each bar of the current symbol using the function CopyTime we get the time and then we copy data of another symbol by this time.

But instead of custom events I would use the OnTimer function, because it is very cumbersome to hang an "indicator-agent" on each symbol...

 
Alex5757000:

Thank you! Useful article... That is, for each bar of the current symbol using the CopyTime function to get the time, and then copy the data of another symbol by this time.

You can do it this way, if you are satisfied with synchronization relatively to the current symbol.

But instead of custom events I would use the OnTimer function, because it is too cumbersome to hang an "indicator-agent" on each symbol...

Use OnTimer, it all depends on your requirements for quality of synchronisation.
 

there is a problem.

MT4

details:

https://www.mql5.com/ru/forum/139759/page13#655069

Новая версия MetaTrader 4 Client Terminal build 432 - MQL4 форум
  • www.mql5.com
Новая версия MetaTrader 4 Client Terminal build 432 - MQL4 форум
 

Probably the biggest disappointment for me is the behaviour of the SeriesInfoInteger, CopyTime, CopyOpen and similar functions.

It turns out that even on weekends, when no new quotes are received, and the existing data is updated,

these functions can give different results with the same parameters. There is a problem with controlling the time series data already present in the terminal.

It has been noticed that the problem occurs when working in multicurrency mode after recompiling indicators, as well as when changing timeframes and restarting the terminal.

CopyOpen() doesn't output an error if we try to copy data from a non-existing piece of history, specifying the date of its start. The function outputs the quote value from an unknown bar.

This behaviour of the function has been detected at USDHKD pair, for which there is no data for last several months on the MQ server.

Thanks to MQ for the new traps!

 

void OnStart()

 {

   Alert("start");

   string arr1[178365];

   char arr2[178365];

   arr1[100002]="hello";

   Alert(arr1[100002]);

   Alert("finish");

  }

At compile time it gives warningsthe size of local variables is too large (more than 512kb) 55.mq5 27 6

On execution2012.07.01 14:37:26 55 (GBPUSD,MN1) stack overflow

Can't I use 2 small arrays? Is it really so much?

I use Metatrader not for trading, I use it for other calculations.

 

Stasikusssss:

...

I would try this: put arrays in a class or in a structure (I don't remember if you can allocate dynamic memory for a structure), allocate memory for the class via new;

Or place definition of arrays in separate function, and play with #property stacksize https://www.mql5.com/ru/docs/basis/preprosessor/compilation. If it's the second variant, arrays cannot be static.

Документация по MQL5: Основы языка / Препроцессор / Свойства программ (#property)
Документация по MQL5: Основы языка / Препроцессор / Свойства программ (#property)
  • www.mql5.com
Основы языка / Препроцессор / Свойства программ (#property) - Документация по MQL5
 
About non-existent quotes: please provide a reproducible example in your code. There must be an error in your code.
 
It is unreasonable to make huge arrays in the stack (over 512 Kb), as the compiler warned us right away.

If large arrays are needed, they should be made dynamic with explicit memory allocation.
Документация по MQL5: Основы языка / Переменные / Создание и уничтожение объектов
Документация по MQL5: Основы языка / Переменные / Создание и уничтожение объектов
  • www.mql5.com
Основы языка / Переменные / Создание и уничтожение объектов - Документация по MQL5
Reason: