Bugs and suggestions for improving CopyTicks() and CopyTicksRange() after build 1485. - page 3

 
MetaQuotes Software Corp.:
Thanks for the message, the bug has been fixed - it will now work in indicators as well. An update will be released soon.
Please tell me if the speed of getting the ticks via CopyTicksRange() will be increased?
 
Build 1491 - language documentation in ME not updated. Information on CopyTicksRange() is only available through the website!
 
In the tester, the ticks from the "pack" (having the same msec time) at the moment (build 1495) are given one at a time. And the tester calculates each one separately. In reality this cannot be the case.
 

I think I've come to the right place. Dear forum members, I've been struggling with this problem on my own for a long time, but I can't seem to solve it. I hope you can help.

The situation is the following: broker Finam (Whotrades), MMA account. I work with 26 Russian securities, i.e. I have 26 open windows and I have a copy of my Expert Advisor hanging in each window. They are using the common C++ library, which has a common window for managing and displaying debugging information.

Some strategy parameters depend directly on the tick tape, so it's very important that all ticks go through the algorithm. Of course, it was a surprise to learn that OnTick() doesn't work on every tick, and not always, even on a tick. As a result, I've come to necessity of using the CopyTicks and CopyTicksRange functions by timer. Due to great efforts (and it's not written anywhere) I've found out, that datetime*1000 is exactly the number of milliseconds since 1970, but it's not the point.
The final result of what we have now is a block of code, which, onTimer, since 10AM starts requesting the latest tick data.

The problem is that, for some reason it is important, on the first day after the metatrader restart, for some securities, tick data starts to arrive only at 11 am (give or take), the next day - everything is normal, it starts at 10 am. The list of these securities is not fixed in any way, in some first day ticks may not come for some securities, in some other - for others.
I thought the problem was caching the ticks. I thought it was a problem with incorrect timing, but that turned out not to be the case. Moreover, it seems that if CopyTicks(Range) couldn't return the data, they could return an error (-1) and everything would make sense. But it returns 0, the array is also zero and GetLastError returns ERR_SUCCESS. I.e. it's just as if those ticks don't exist, which is strange as they are present in the ribbon in the window.

I'm at a loss. Hope you can tell me what to do, or at least the direction in which to move.

If you need to provide the code, I'll, with the next comment, clean it up from the "extra" commands and post it.

Thank you!

 
antru:

Yes, a code is desirable. Is it a real or demo account? What is the build of the terminal?

Honestly, I don't know if anyone here works with your broker. If no one here reacts to your post - write to ServiceDesk, you can link directly to your post. They will also need to provide a code.

 
antru:
You're better off going straight to the service desk with the code to play it back.
 
Alexey Kozitsyn:

Yes, a code is desirable. Is it a real or demo account? What is the build of the terminal?

Honestly, I don't know if anyone here works with your broker. If no one here reacts to your post - write to ServiceDesk, you can link directly to your post. They will also need to provide a code.

The account is real, latest build, 1525. I think here's what to do. Create the naked tick-taking code without the strategy algorithm. Run it. If it fails to work, you should call the service desk. If it does work, perhaps one should seek the errors in one's own code.

Thank you for mentioning the service desk, I didn't know it was possible. I looked on the metaquotes website, all the contacts are phone numbers in cyprus and china, not a single email.

 
Andrey Khatimlianskii:
Better to go straight to the service-desk with the code to play it back.
Thank you!
 
antru:

The account is real, the build is latest, 1525. I think this is what we should do. Make a bare tick-taking code without the strategy algorithm. Run it. If it does not work, then take it to the service desk. If it does work, perhaps one should seek the errors in one's own code.

Thank you for mentioning the service desk, I didn't know it was possible. I looked on the metaquotes website, all the contacts are phone numbers in cyprus and china, not a single email.

Exactly what you need, your strategy, in this case, will only get in the way of identifying the problem. What is needed is a code of how you request the ticks.
 
antru:

I think I've come to the right place. Dear forum members, I've been struggling with this problem on my own for a long time, but I can't seem to solve it. I hope you can help.

The situation is the following: broker Finam (Whotrades), MMA account. I work with 26 Russian securities, i.e. I have 26 open windows and I have a copy of my Expert Advisor hanging in each window. They are using the common C++ library, which has a common window for managing and displaying debugging information.

Some strategy parameters depend directly on the tick tape, so it's very important that all ticks go through the algorithm. Of course, it was a surprise to learn that OnTick() doesn't work on every tick, and not always, even on the tick. As a result, I've come to necessity of using the CopyTicks and CopyTicksRange functions by timer. Due to great efforts (and it's not written anywhere) I've found out, that datetime*1000 is exactly the number of milliseconds since 1970, but it's not the point.
The final result of what we have now is a block of code, which, onTimer, since 10AM starts requesting the latest tick data.

The problem is that, for some reason it is important, on the first day after the metatrader restart, for some securities, tick data starts to arrive only at 11 am (give or take), the next day - everything is normal, it starts at 10 am. The list of these securities is not fixed in any way, in some first day ticks may not come for some securities, in some day - for others.
I thought the problem was caching the ticks. I thought it was a problem with incorrect timing, but that turned out not to be the case. Moreover, it seems that if CopyTicks(Range) couldn't return the data, they could return an error (-1) and everything would make sense. But it returns 0, the array is also zero and GetLastError returns ERR_SUCCESS. I.e. it's just as if these ticks don't exist, which is strange as they are present in the ribbon in the window.

I'm at a loss. Hope you can tell me what to do, or at least the direction in which to move.

If you need to provide the code, I'll, with the next comment, clean it up from the "extra" commands and post it.

Thank you!

Try to use all possible ways of getting the ticks and OnTisk and CopyTicks, and then compare the results and use the most adequate one.
Reason: