Previous bar ticks

 
I need to get all values of ticks of the the before previous bar into array
Array1[];
Is it possible to get them right after EA is put on chart?
Many thanks for help.
 

ticks are not stored, only OHLC (in bid price) in addition to the current Ask and current Bid, so you can't access the ticks that already occurred. You can of course setup an array to store ticks as they come in once your EA is active on a chart.

 
1005phillip:

[...] You can of course setup an array to store ticks as they come in once your EA is active on a chart.

For completeness: with the caveat - frequently mentioned on this forum - that an EA is not guaranteed to receive every tick and, in real life, definitely will not receive every tick.

 
Strange. Why EA not receive every tick? Then what can receive every tick?
 
Brygada:
Strange. Why EA not receive every tick? Then what can receive every tick?

Because if your EA is still processing a tick, it will ignore new ticks until it has completed processing the tick that triggered it.

 
Viffer:

Because if your EA is still processing a tick, it will ignore new ticks until it has completed processing the tick that triggered it.

And also because ticks get dropped as a result of MT4 as a whole being busy (not just a particular EA), and because of network issues. Lots of discussion of this in relation to not using Volume[0] == 1 to check for new bars. For example, see https://www.mql5.com/en/forum/109887.

And then there's the question of what "every tick" means in an OTC market...

 
I remember one time I was trying to make Volume[0]==1 and suddenly the new bar started with 3 ticks already.
As it is seen that the indicator did not registered 2 previous ticks.

Is there any way to code to get all the ticks registered?Maybe somehow using fractional seconds and
changed bid levels? Or maybe something more simple?
 

Brygada if the ticks aren't registering then it means you couldn't/wouldn't have been able to take action on them anyways so why worry about them? As jjc wrote...what's a "tick" mean in an OTC off-exchange retail market like the spot-forex we all access via MT4?

 
Brygada:
Maybe somehow using fractional seconds and
changed bid levels? Or maybe something more simple?

It's the tick that drives everything rather than the time. You could get 2 or three ticks in a second and catch them all. The time between ticks, be that a fraction of a second or a minute, is irrelevent.

As JJC says, there are many reasons ranging from a busy EA/platform/server to a lost connection. You will get most of them though. Whether there is a solution to capture every single tick... thats above my pay grade I'm afraid but I doubt it.


 
Thanks for all your inputs. Sure, if server is busy, then we cannot do anything.
 
Regarding 'Network Issues' - I have a good example of how much of an affect these have on incoming ticks:

I have two Tick-Loggers, a primary and a backup, running 24/7 logging ticks for same currencies/account/broker. The primary logger sits on a server that's near the broker. The backup logger sits on my secondary computer at home. The backup logger consistently logs ~20% less ticks than the primary logger (for months now). I have verified and verified again the cause of this - network issues. The connection between my home computer and the broker's server is simply not very good.
Reason: