The indicator is too slow, rewrite the indicator - page 2

Ariyanto
144
Ariyanto  

ho to get that message into notification? anyone knows?

Umar Ismail
22428
Umar Ismail  
Ariyanto Ariyanto:

ho to get that message into notification? anyone knows

via hp android?

daftarin dulu mqid nya

Doerk Hilger
1583
Doerk Hilger  

Its not a bug in your code its simply too much data which is processed. When you deal with databases,especially online databases that you query during your indication, the internal timeout can occur and will produce this message.


Easiest way out: Dont process all bars, process only those that you need. You could declare something like maxDays and compare the time[] value if its below or in the time range. MQL indicator frame is designed to always process everything, which is surely not necessary in 99% of all cases.

Guillaume Perinet
46
Guillaume Perinet  
Icham Aidibe:

Hi !

Here's the error message I get using and indicator on a EA. It worked perfectly, then show that.

Unfortunately, I restarted the terminal so I can't copy past the exact log.

Anyone has experienced such an error ?

PS : it worked 'til now.

I did have with the indicator Tether_Line and sincerely, it was way too long : "2020.11.21 02:05:24.936    Tether_Line EURAUD,M2: indicator is too slow, 21343 ms. rewrite the indicator, please"!

Now, if you put a few of them on the same chart, you will probably crash MT4 until you remove the file chartxx.chr which contains this "too long" indicator (only remove after your MT4 is closed) : delete the file or remove the specific lines where this indicator is called (with a notepad). To avoid this, yes, I guess the only way out is to use a max number of bars, only the necessary one.

William Roeder
23727
William Roeder  
Guillaume Perinet: To avoid this, yes, I guess the only way out is to use a max number of bars, only the necessary one.
  1. If it's only on terminal startup after a Windows reboot, everything is slow (paging) - don't worry about it.

  2. If it takes too long to compute, reduce Tools → Options (control+O) → Charts → Max bars in chart to something reasonable (like 1K.)

  3. Or, as a last resort, use my segmented OnCalculate include file.
              Your indicator is too slow... - Indices - MQL4 programming forum #1.6