Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
I'm facing one weird problem. I notice the EA i wrote is way slower than EA generated using EA generator wizard.
I'm trying to troubleshoot and eventually removed all codes and it is still slower than EA generated using the generator.
does anyone have the same problem? the "Empty EA" literally does nothing.
All other area remain constant during testing. e.g. using OLTP, using the same 6 months duration, same symbol etc.
How can an empty EA be "slower"? How do you even know when it's "done"?
Other than that, I'm thinking the most likely culprit is where you're putting your enries and exits. Are you doing it in OnTick()? Or are you somehow checking for a new candle and only processing indicator updates and entries/exits on new candles?
That was one of the biggest things I learned early on writing EAs -- unless you're doing something really weird, you probably don't need to do much on every tick, but only on new candles. That'll make a huge difference in EA speed.
Your comment is unclear; are you saying that the Empty ea is slower than the "generated" ea?
Your comment is unclear; are you saying that the Empty ea is slower than the "generated" ea?
yes. i'm saying the EA without any logic in OnTick() running slower in tester compare to "generated" EA.
it also shown over profiler where a complex "generated" EA seems to have same CPU time with EA that laterally does nothing. (check the code in 1st post).
How can an empty EA be "slower"? How do you even know when it's "done"?
Other than that, I'm thinking the most likely culprit is where you're putting your enries and exits. Are you doing it in OnTick()? Or are you somehow checking for a new candle and only processing indicator updates and entries/exits on new candles?
That was one of the biggest things I learned early on writing EAs -- unless you're doing something really weird, you probably don't need to do much on every tick, but only on new candles. That'll make a huge difference in EA speed.
for my own EA, i'm processing indicator updates only on new candles.
in this specific post, i'm referring to the EA that does nothing in OnTick() run slower than generated EA where it complete almost within 1 seconds, where the empty EA run for about 8-10 seconds over tester.
it also show almost the same cpu utilization over the profiler
dreamsky2007 #:
yes. i'm saying the EA without any logic in OnTick() running slower in tester compare to "generated" EA.
it also shown over profiler where a complex "generated" EA seems to have same CPU time with EA that laterally does nothing. (check the code in 1st post).
for my own EA, i'm processing indicator updates only on new candles.
in this specific post, i'm referring to the EA that does nothing in OnTick() run slower than generated EA where it complete almost within 1 seconds, where the empty EA run for about 8-10 seconds over tester.
it also show almost the same cpu utilization over the profiler
I am unable to reproduce your claims. I also tested the empty code without a return in OnTick() ...
2023.11.17 03:21:16.425 Terminal MetaTrader 5 x64 build 4040 started for MetaQuotes Software Corp. 2023.11.17 03:21:16.425 Terminal Windows 10 build 19045, 8 x Intel Core i7-4790T @ 2.70GHz, AVX2, 7 / 15 Gb memory, 150 / 893 Gb disk, touchable, UAC, GMT+0 2023.11.17 03:25:07.172 Core 1 EURGBP,M1: testing of Experts\(Test)\empty with return.ex5 from 2022.01.02 00:00 to 2022.12.31 00:00 started 2023.11.17 03:25:08.758 Core 1 EURGBP,M1: total time from login to stop testing 0:00:07.972 (including 0:00:00.262 for history data synchronization) 2023.11.17 03:26:08.340 Core 1 EURGBP,M1: testing of Experts\(Test)\empty no return.ex5 from 2022.01.02 00:00 to 2022.12.31 00:00 started 2023.11.17 03:26:09.955 Core 1 EURGBP,M1: total time from login to stop testing 0:00:07.834 (including 0:00:00.113 for history data synchronization) 2023.11.17 03:26:58.267 Core 1 EURGBP,M1: testing of Experts\(Test)\generator.ex5 from 2022.01.02 00:00 to 2022.12.31 00:00 started with inputs: 2023.11.17 03:27:25.085 Core 1 EURGBP,M1: total time from login to stop testing 0:00:32.901 (including 0:00:00.105 for history data synchronization)
The "empty" run for 7-8 seconds, while the "generator" ran for 32-33 seconds, for 1 year of testing period on M1.
All code examples were compiled with "X64 Regular (Maximum Optimisation)" in non debug mode, and tested with real ticks.
Please provide information on how the code is being compiled on your end and what test settings you are using.
Also provide log output of the testing with the time stats as I have done. Include also details on build and operating system, ram, etc.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I'm facing one weird problem. I notice the EA i wrote is way slower than EA generated using EA generator wizard.
I'm trying to troubleshoot and eventually removed all codes and it is still slower than EA generated using the generator.
does anyone have the same problem? the "Empty EA" literally does nothing.
All other area remain constant during testing. e.g. using OLTP, using the same 6 months duration, same symbol etc.
Empty EA:
EA generated using generator:- this code generated using wizard without any modification