![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Just a few days ago I encountered this error when creating a custom symbol. Re-checked a lot of things by hand. I also noticed a very strange bug, that after ArrayCopy some ticks got random values. Since it was rather painful to repeat it on clean machine, I have generated from casts another synthetic custom one, and attitude to the reports here lately is peculiar, namely complete ignoring, I have not started to make a report. But solved the issue with a single call toCustomTicksAdd. I.e. all tics at first filled in one array, at that manually copied and then it by one call to custom symbol. That way, no errors are thrown. Try it.
P.S. I should add, that I have bumped into all sorts of strange bugs with CopyTicks, I have switched over to CopyTicksRange.
Looked at the code more closely. You are missing ticks when receiving portions. The situation is possible when Ticks[Limit - 1].time_msc == Ticks[Limit + k], k >= 0.
Correspondingly, when you add a skip, the flags may not match.
I'm omitting it intentionally in this test to guarantee absence of overlapping, because the etiology of the problem is not clear yet, and it may be caused by duplicated ticks (by analogy with Andrey, I decided to exclude the very possibility by "quick and dirty" method).
Regarding the flags, please elaborate. Contents of ticks (including flags) never change, and I haven't read anything about some influence of flags on sequence of ticks. At least, the description of the error code says nothing about flags.
About the flags, please elaborate. No one changes the contents of ticks (including flags), and I haven't read anything about any influence of flags on the sequence of ticks. At least the description of the error code doesn't say anything about flags.
As for flags, it's a hypothesis. Some time ago I had a problem with them, so I generated flags for external ticks myself before sending them.
For example, after passing the first tick has a different bid price, but there is no flag about it.
It is not clear why this line, if the variable _start with ms incremented by one is not used anywhere else.
And when the function exits, it is destroyed.
As I see it, the time shift is not used or remembered anywhere.
And why do you assign something to this _start variable, which serves as an input variable.
It will return this value back to the while function and there is a deadlock in its use.
So, the code is rather confusing and unclear. Or I don't understand this construct ))
It is not clear why this line, if the variable _start with ms incremented by one is not used anywhere else.
And when the function exits, it is destroyed.
As I see it, the time shift is not used or remembered anywhere.
And why do you assign something to this _start variable, which serves as an input variable.
It will return this value back to the while function and there is a deadlock in its use.
So, the code is rather confusing and unclear. Or maybe I don't understand this construction))
This variable reference is thrown in a function parameter "in place" from the calling code, constantly changes and is used in iterations.
On flags - a hypothesis. Once there was a problem with them, so for third-party ticks I generated flags myself before sending.
For example, after passing the first tick has a different bid price, but there is no flag about it.
The idea is clear. But without MQ's explanation it will all remain at the level of our speculation (in terms of possible influence on the appearance of this or that error).
This variable reference - thrown in a function parameter "in place" from the calling code, constantly changing and used in iterations.
Yes, I didn't pay attention to the reference, and wanted to offer for it, but it is there.
Try to explicitly allocate a variable to save the extended time.
New mystery. Problem with CopyTicks on build 2507, worked fine on older builds (particularly 2374).
Reduced it to a simple test script in the app. It asks for new ticks since the previous poll.
Soon after the first successful loop pass, the script starts copying ticks to the array with the time known to be earlier than the one specified in the from parameter, i.e. from the beginning of the current day.
What's the problem?
New mystery. Problem with CopyTicks on build 2507, worked fine on older builds (particularly 2374).
Reduced it to a simple test script in the app. It asks for new ticks since the previous poll.
Soon after the first successful loop pass, the script starts copying ticks to the array with the time known to be earlier than the one specified in the from parameter, i.e. from the beginning of the current day.
What's the problem?
I confirm the bug in 2509.
This variant doesn't seem to fail.