EA slower processing ticks than Indicator

 

Hi, I used simple code to write the ticks to file and found that indicators wrote more ticks than the same code in an EA. I used two EURUSD M1 charts in the same instance of MT4. I swapped the charts and got the same results

Here is the results from indicator next to EA:

And here is an indicator next to an identical indicator (each in its own EURUSD M1 chart, on the same MT4 instance):


Here's the EA code:

int handle;

void init()  {
   handle = FileOpen(Symbol()+"-----EA.csv",FILE_CSV|FILE_WRITE,',');
   FileWrite(handle,"time,bid,ask,volume");
   return;
}


void deinit()  {
   FileClose(handle);
   return;
}


void start() {
   FileWrite(handle,StringConcatenate(TimeCurrent(),",",DoubleToStr(Bid,Digits),",",DoubleToStr(Ask,Digits),",",DoubleToStr(Volume[0],0)));
   return;
}

The indicator code is the same but with a different csv filename and:

#property indicator_chart_window

Am I missing something or can I conclude EA tick processing is somehow a little slower than indicators?

 
EA's can't process another incoming tick if they still processing on a tick
 
deVries:
EA's can't process another incoming tick if they still processing on a tick


Indicators can?

(there are still a few missed ticks from the indicators, according to the M1 volume number)

 
deVries:
EA's can't process another incoming tick if they still processing on a tick
Neither can an Indicator. Maybe the Interface thread has higher priority so as a consequence it misses fewer ticks.
 
alladir:


Indicators can?

(there are still a few missed ticks from the indicators, according to the M1 volume number)


test it make same code as EA as indicator and you can place them on same chart ....

i 'm not bothering about every tick it is impossible to open trade every tick or close at every tick

 
RaptorUK: Neither can an Indicator. Maybe the Interface thread has higher priority so as a consequence it misses fewer ticks.

https://www.mql5.com/en/forum/143712. Perhaps thats the case.

alladir: Am I missing something or can I conclude EA tick processing is somehow a little slower than indicators?

Are you trying to give us home_work? .

Just wondering why you don't trust your conclusions that all.

 
RaptorUK:
Neither can an Indicator. Maybe the Interface thread has higher priority so as a consequence it misses fewer ticks.

That sounds reasonable.

I performed another test on EAs a few years ago. I tested EA with a start() method versus EA with an infinite loop and a RefreshRates() statement. The infinite loop was 10 ms ahead every time.

 

Ovo:

That sounds reasonable.

I performed another test on EAs a few years ago. I tested EA with a start() method versus EA with an infinite loop and a RefreshRates() statement. The infinite loop was 10 ms ahead every time.

How did you measure to ms accuracy?

ubzen:

https://www.mql5.com/en/forum/143712. Perhaps thats the case.

Are you trying to give us home_work? .

Just wondering why you don't trust your conclusions that all.


I find I'm rarely right first time.. :] Worth checking if I did something stupid
 
alladir:

How did you measure to ms accuracy?


I use the GetLocalTime to measure time.
Reason: