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
After a successful call to CopyTicks offline, GetLastError returns 4403.
I'll do it via CopyTicksRange, but the CopyTicks behaviour seems right to change.
CopyTicks (build 1881) returns older data than requested, if not fresh ticks are requested. I.e. it returns data older than from parameter. Bug is floating - it appears at different times, so I wrote some small code that reproduces it. I ran it in tester on EURUSD H1, 2017.08.01 - 2018.08.01.
Here's the output:
2018.10.17 21:31:26.221 2017.08.01 12:00:00 dt[0]=2017.08.01 03:00:00
2018.10.17 21:31:26.221 2017.08.01 12:00:00 cnt=2000
2018.10.17 21:31:26.221 2017.08.01 12:00:00 ERROR: i=0, ticks[i].time_msc=1501552175606 (2017.08.01 01:49:35)
I.e. we requested from 03:00 and received from 01:49. In real conditions, the difference was more than a month.
Here is a question for the experts. What potential errors can there be with this method of obtaining fresh ticks?
The order of ticks with the same time is not guaranteed, it seems.
Forum on trading, automated trading systems and trading strategy testing
Real time ticks
Andrey Khatimlianskii, 2020.01.31 14:40
By the way, there isan excellent article by Vasily Sokolov on correct collection of ticks. There in details it's analogue synchronisation process (which I don't have, because of which sometimes same ticks are printed):
But CopyTiks function doesn't allow requesting N last ticks. Instead it provides all ticks, which came from the specified moment of time. This complicates the task. We should perform a query, get an array of ticks and compare it with an array of ticks, received on the previous update. At the same time, we'll find out which newly arrived ticks are not part of the "previous supply", i.e. they are new. But it's impossible to compare ticks between them directly, simply because there may be no visible differences between them at all. For example, let's look at the table of deals below:
Figure 5. Table of all deals with an example of identical deals.
We immediately see two groups of absolutely identical ticks. They are marked with red frames, they have the same time, volume, direction and price. Thus, we see that it is impossible to compare individual ticks with each other.
But it is possible to comparea group of ticks. If two groups of ticks are equal to each other, we can conclude that these and following ticks were already analysed during the previous price update.
The order of ticks with the same time is not guaranteed, it seems.
If you're talking about groups of ticks, there seems to be nothing wrong with that in the code.
Result (run cold - immediately after the Terminal starts).
It is possible to switch off the Expert Advisor, nothing will change in terms of consumption by the Terminal.