You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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 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 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...
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...
there is a problem.
MT4
details:
https://www.mql5.com/ru/forum/139759/page13#655069
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.
If large arrays are needed, they should be made dynamic with explicit memory allocation.