Comparing optimization speed between MT4 and MT5

 

Hi, there!

I am interested in having a good idea of how faster MT5's optimization speed is compared to MT4. Could not find any forum threads on MQL4.com related to it, so I thought of doing tests myself.

But to achieve that I would need two versions of a robot implementing the same strategy on both MQL4 and MQL5, and preferably with 5 or more parameters available for optimization (to really push the processing times!).

I tried to find such robot online but had no luck, so I was wondering if anyone out there could help me out?

At this point I only need two incarnations of the same robot with the required minimum number of parameters. This robot can be a simple one, and obviously doesn't even need to be profitable!! :-)

Thanks in advance! 

 
There are the macd_experts which comes with both platforms. They should also be within the code-bases.
 
pipnotic:

Hi, there!

I am interested in having a good idea of how faster MT5's optimization speed is compared to MT4. Could not find any forum threads on MQL4.com related to it, so I thought of doing tests myself.

But to achieve that I would need two versions of a robot implementing the same strategy on both MQL4 and MQL5, and preferably with 5 or more parameters available for optimization (to really push the processing times!).

I tried to find such robot online but had no luck, so I was wondering if anyone out there could help me out?

At this point I only need two incarnations of the same robot with the required minimum number of parameters. This robot can be a simple one, and obviously doesn't even need to be profitable!! :-)

Thanks in advance! 

There are plenty on mql5.com codebase. Converted from MT4.
 
pipnotic:

Hi, there!

I am interested in having a good idea of how faster MT5's optimization speed is compared to MT4. Could not find any forum threads on MQL4.com related to it, so I thought of doing tests myself.

But to achieve that I would need two versions of a robot implementing the same strategy on both MQL4 and MQL5, and preferably with 5 or more parameters available for optimization (to really push the processing times!).

I tried to find such robot online but had no luck, so I was wondering if anyone out there could help me out?

At this point I only need two incarnations of the same robot with the required minimum number of parameters. This robot can be a simple one, and obviously doesn't even need to be profitable!! :-)

Thanks in advance! 

You need to export the History data from your MT5 platform and use that data with your MT4 platform to get a sound comparison.  Otherwise if your MT5 data has many, many more ticks per bar than your MT4 platform the MT5 test will be slower due to the greater number of ticks.

You don't need many parameters,  just increase the range and decrease the size of the step. 

 
pipnotic: I am interested in having a good idea of how faster MT5's optimization speed is compared to MT4.
All things being equal (same number of ticks, settings, code) MT5 will be n times faster, (n being the number of CPUs on your system) MT4 is single threaded - one combination at a time.
 
WHRoeder:
All things being equal (same number of ticks, settings, code) MT5 will be n times faster, (n being the number of CPUs on your system) MT4 is single threaded - one combination at a time.
Right, you can read about that here (not directly related to optimization though).
 

Thanks, ubzen and angevoyageur! I've installed MT5 and opened a demo account, and was happy to see that MT5 also comes with a "MACD Sample" expert.

Since both MQL4 and MQL5 MACD sample experts have the same input parameters, I guess they are using the same strategy (though it would be great if someone had the time to have a quick glance at both and verify that! I've attached them as a zip file!). ;-)

Interesting how (to my knowledge) MT5 does not allow us to fix the spread when backtesting. Am I right in saying that backtesting in MT5 uses "dynamic" spreads defined by the bid/ask tick prices stored in the historical data?

I also noticed that we do not have direct access to the data history. So thanks for the suggestion on exporting MT5 history data into MT4, RaptorUK, that should guarantee a common starting point! I just hope VantageFX won't give me any data "gaps" that I read about in the forums, as seemingly I would not be able to fix them since this data comes from the Broker server.

I understand that MT5 data contains "direct" tick information while MT4 data is based on M1 data. But now I don't know if, for the sake of a fair comparison, I should set MT5 backtesting execution level to "1 minute OHLC" since MT4 uses M1 data, or if I should leave MT5 backtesting as using "every tick" since MT4 interpolates the data to generate "tick data" at run-time. Any comments on that?

Anyway, I guess the answer will be clear when comparing the optimization times, since WHRoeder's estimation should be a good reference!

 
pipnotic:


I understand that MT5 data contains "direct" tick information while MT4 data is based on M1 data. But now I don't know if, for the sake of a fair comparison, I should set MT5 backtesting execution level to "1 minute OHLC" since MT4 uses M1 data, or if I should leave MT5 backtesting as using "every tick" since MT4 interpolates the data to generate "tick data" at run-time. Any comments on that? 

No,  the MT5 tick data is synthesised from the M1 data also.  Use Every tick for MT5.
 
pipnotic: I understand that MT5 data contains "direct" tick information while MT4 data is based on M1 data. 

They're both based on m1_data. In other words, history is not saved in tick_data. The synthetic ticks generated in mt5_tester is just little more complex than mt4. Try using open mode tests with period_m1.

Some performance test's have been performed on this forum. It's not optimize tests but might be worth a glance.

https://www.mql5.com/en/forum/136251 

https://www.mql5.com/en/forum/138969 

 

Humm, very interesting! With all the hype around MT5, I would have expected otherwise!

If MT5 generates tick data from M1 data (similar to MT4), which spreads does it use when backtesting?

When optimizing/backtesting in MT4, I like to have the terminal offline and control the spreads manually by editing the symbols.sel file.

I know that file does not exist in MT5, but I surely would like to know which spreads MT5 is using when optimizing/backtesting!!! ;-)

If anything, I would like to have both MQL4 & MQL5 versions of the robot executing similar numbers of trades for the same period...

 
pipnotic:

Humm, very interesting! With all the hype around MT5, I would have expected otherwise!

If MT5 generates tick data from M1 data (similar to MT4), which spreads does it use when backtesting?

When optimizing/backtesting in MT4, I like to have the terminal offline and control the spreads manually by editing the symbols.sel file.

I know that file does not exist in MT5, but I surely would like to know which spreads MT5 is using when optimizing/backtesting!!! ;-)

If anything, I would like to have both MQL4 & MQL5 versions of the robot executing similar numbers of trades for the same period...

Spread is taken from M1 data in MT5, you can't change it.

Reason: