Without testing it... (some remarks)
You should first do an ArrayCopy and than ArrayFree...
You cannot use ArrayCompare with MqlTick as this is a struct and so a complex type.
COPY_TICKS_TRADE might not work for currencies...
Arrays start with index 0...
Regards Uwe
Thanks Uwe,
I didn't know that ArrayCompare does not work with MQLTICK.
This EA is for Bovespa, so I think that I can use COPY_TICKS_TRADE.
I know that the arrays begins with 0. But sometimes I receive more than 1 tick, so I need to know if I already analyzed it or it is new. Any suggestions?
Regards Otavio
Thanks Uwe,
I didn't know that ArrayCompare does not work with MQLTICK.
This EA is for Bovespa, so I think that I can use COPY_TICKS_TRADE.
I know that the arrays begins with 0. But sometimes I receive more than 1 tick, so I need to know if I already analyzed it or it is new. Any suggestions?
Regards Otavio
There is no problem using ArrayCompare() with MqlTick which is a simple structure (not a complex one). Though I am not sure ArrayCompare() is useful here.
If you want the new ticks just request them by time from the last one you already have.
ulong from=0, // date starting from which ticks are requested
There is no problem using ArrayCompare() with MqlTick which is a simple structure (not a complex one). Though I am not sure ArrayCompare() is useful here.
If you want the new ticks just request them by time from the last one you already have.
Thank you, this way is better. I'll try.
What is your objective?
Are you trying to calculate the volume executated? Book agression?
Anyway, I sugest you to useCopyTicks(). This function get the ticks directly in an array in the right sequency. So, you don't have to worry about which one is new or not, just use its values and times.
I also sugest some reading:
https://www.mql5.com/pt/forum/165484
https://www.mql5.com/pt/forum/90503
https://www.mql5.com/en/articles/1793 (https://www.mql5.com/pt/articles/1793)


- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello, I 'm trying to analyse each tick in real time. I'm using Copytick, but I'm having trouble to know which ticks are new. I'm copying the ticks for 2 arrays and comparing them. But it's not working. Any suggestions? Is there an easier way?
Olá, Eu estou tentando analisar cada tick em tempo real. Eu estou usando Copytick, mas eu estou tendo problema para saber quais ticks são novos. Eu estou copiando os ticks para 2 arrays e comparando elas. Mas não está funcionando. Alguma sugestão? Existe uma maneira mais fácil?