You probably have a huge amount of "Deals" (or maybe many "Pending Order" operations) for the test period.
That has been the only time I have noticed long delays in generating the final test report on MT5.
You probably have a huge amount of "Deals" or "Pending Orders" for the test period.
That has been the only time I have noticed long delays in generating the final test report on MT5.
okay thank you,
I will look into that.
SOLUTION!!! On MQL5 iCustom Indicators must be Defined inside int OnInit( ) Function.
I have the solution,
All My MT5 Backtests were extremely slow, even on my other computer that is slightly higher spec of 4 cores. I thought well maybe this is just the way MT5 is, better get used to it.
The Mistake I Made:
On MQL5 iCustom Indicators must be Defined inside int OnInit( ) Function.
In MQL4 I always put iCustom indicators inside OnTick( ), ( I actually only use OnBar() function, which is triggered inside OnTick() ) ,
Now I am wondering should iCustom been inside OnTick() all this time?
So now my MQL5 Backtests are SuperFast; a 10 year USDJPY 1hour Bar Backtest Completed in 6 seconds, thank You!!!
These Resources should help anyone with ultra Slow Backtests.
Comparison of Same EA using iCustom indicator (From OrchardFx):
Using iCustom to write Expert Advisors – Orchard Forex
MQL5 EA:
MQL4 EA version of the Above :
mt4_simple_ea_template/Experts/Orchard/iCustom Examples/ParabolicCustom/ParabolicCustom.mq4 at main · OrchardForexTutorials/mt4_simple_ea_template · GitHub
- OrchardForexTutorials
- github.com
Then it seems you never read the MQL5 documentation. It has always been the case that the handle to indicators, such as with iCustom, be obtained in OnInit or class initiators.
It has been discussed many times on the forum and the example code in the documentation even shows the handle being obtained in the OnInit handler.

- www.mql5.com
Then it seems you never read the MQL5 documentation. It has always been the case that the handle to indicators, such as with iCustom, be obtained in OnInit or class initiators.
It has been discussed many times on the forum and the example code in the documentation even shows the handle being obtained in the OnInit handler.
Sigh! You are correct, I did not read the MQL5 Documentation regarding iCustom(), I will have to look at all my MQL4 EAs tomorrow.
@Fernando Carreiro, you are a credit to the MQL4/5 universe.
@Fernando Carreiro, you are a credit to the MQL4/5 universe.
MQL5 works differently to MQL4.
In MQL4, collecting data from indicators is not via a handle. Instead data is collected directly from the function calls.
So, in MQL4 it is necessary to call iCustom when needed in OnTick, unlike in MQl5.
MQL5 works differently to MQL4.
In MQL4, collecting data from indicators is not via a handle. Instead data is collected directly from the function calls.
So, in MQL4 it is necessary to call iCustom when needed in OnTick, unlike in MQl5.
Yes that is what I thought, but was going to double check.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Greetings, I have been coding on MQL4 for a year and have recently transitioned to MQL5.
After a Backtest is completed,(non visual mode) MT5 always takes approx, 15 minutes to generate the Backtest Report and Chart with deal maps.
In MT4 Report this is generated < 1 minute.
Please My See my Attached images:
- In the 1st image, test finished (final balance $$$) at 09:08, and it wasn't until 09:24 I got the Bactest Report.
-I am using Windows 10 64-Bit, Local: 2 Cores, 2x Pentium Dual-Core E5800 @ 3.20GHz, 8191MB (RAM)
Question: Is this Normal For MT5, I thought MT5 was supposed to be quicker, or is it just me?