How others use CopyTicks is beyond me. No trust, unfortunately. Very raw.
EA
#include <TypeToBytes.mqh> // https://www.mql5.com/ru/code/16280voidOnTick( void )
{
staticMqlTick PrevTick;
staticint Amount = 0;
MqlTick Ticks[];
if (Amount > 0)
{
Amount = CopyTicks(_Symbol, Ticks, COPY_TICKS_ALL, PrevTick.time_msc);
int i;
for (i = 0; i < Amount; i++)
if (_R(Ticks[i]) == PrevTick) // https://www.mql5.com/ru/code/16280break;
if (i == Amount)
Print("В истории (length = " + (string)Amount + ") нет тика, что был на предыдущем Event.");
}
else
Amount = CopyTicks(_Symbol, Ticks, COPY_TICKS_ALL, TimeCurrent() * 1000);
if (Amount > 0)
PrevTick = Ticks[Amount - 1];
}
Result
2016.09.1511:04:02.810 Test2 (RTS-9.16,M1) В истории (length = 2) нет тика, что был на предыдущем Event.
2016.09.1511:03:59.312 Test2 (RTS-9.16,M1) В истории (length = 13) нет тика, что был на предыдущем Event.
2016.09.1511:03:59.290 Test2 (RTS-9.16,M1) В истории (length = 1) нет тика, что был на предыдущем Event.
The tick that was in the history is already absent in the next Tick-event!
Dear developers, bring CopyTicks to a working condition. Even simple tests are failing.
For example
Slightly reworked
Result
It turns out that both prices change to zero from non-zero values. And after zeros go back to non-zeros.
Indicator shows that CopyTicks may not be giving away the last ticks
Even more interesting
ResultCopyTicks can both lag behind and be ahead of the Event-tick. Event-tick often has a zero flag.
ZZY Correct the MqlTick flag to flags in the MqlTick help.
How others use CopyTicks is beyond me. No trust, unfortunately. Very raw.
EA
Result
The tick that was in the history is already absent in the next Tick-event!
Dear developers, bring CopyTicks to a working condition. Even simple tests are failing.
I need to add new history ticks to the array on each OnTick. Has anyone implemented this?
I'm struggling - it's not working. I can't manage to bypass curvature of CopyTicks.
At the moment CopyTicks with some stretch, but works in real time with input parameter from == 0.
Here's one of the stretchesReceive the extreme ticks, and find that the most recent tick has a shorter time than the previous one.
Check out the code for this indicator
https://www.mql5.com/ru/forum/94399/page6#comment_2776784
We take the extreme ticks, and find that the most recent tick has a shorter time than the previous one.
Do I have to write to Service Desk about the reports in this thread or do the developers monitor it themselves?