Ticks based EA: need a hint

 

Hello everybody,

I am a newcomer in MQL4 (and only an occasional programmer). Currently I am working on my first EA attempt which should be a tick based EA.

My problem is I need to get a certain number of actual ticks into a buffer (a tick array) before my start() function itself can start operating.

So, I need to collect certain number of ticks from the market first (feed the buffer with data) so that my main program can start making all kinds of required calculations and actions.

My first idea was to collect necessary ticks within init() function, and, in this way to make all necessary preparations for the main program.

But then I realized that init() function is called at the beginning of the program only once and will not help me with tick-by-tick buffering.

Placing initial data collection within start() function is, of course, not possible as well.

Pls, do you have some hints / ideas of how I can manage the initial tick collection within my EA?

I just need a basic hint, no code work, thanks.

 
Sidewinder:

Placing initial data collection within start() function is, of course, not possible as well.


Why not ? If you need 100 ticks count them, if (tickcount < 100) return(0);
 
RaptorUK:
Why not ? If you need 100 ticks count them, if (tickcount < 100) return(0);

Ooops...

That's it! Looks so easy now... :-)

I definitely need more experience and not to complicate things more then they are...

Thanks again, RaptorUK!