To slow backtest of SQX strategies in MT4

Hi!

I realized, that the backtest in MT4 is very slow if I let run an SQX strategy. In the case of an old SQ3 strategy I don't encounter such a problem.
Could be the "problem" perhaps the to much log of the SQX strategy during the MT4 backtest?

Brg: Csaba
Attachments
No attachments
  • Votes +3
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

l
#1

Csaba

01.10.2019 01:34

Task created

h
#2

hankeys

01.10.2019 09:31
Voted for this task.
h
#3

hankeys

01.10.2019 09:32
yes, one tick backtest lasts for 30 minutes, even if i turn off logging...but i think its still logging?
l
#4

Csaba

01.10.2019 09:44
Hm? Could we turn off logging? How?
h
#5

hankeys

01.10.2019 14:45

you can change it right in the MQL code, or in your MQL template


but i dont see any difference between those settings at all...dont know why...



//+------------------------------------------------------------------+

// Verbose mode values:

// 0 - don't print messages to log at all

// 1 - print messages to log only when trading (not when backtesting)

// 2 - print messages to log always

//+------------------------------------------------------------------+

int sqVerboseMode = 1;

TB
#6

Tomas Brynda

28.11.2019 09:58

Status changed from New to Waiting for information

Hi,

have you tried setting sqDisplayInfoPanel to false in your EA?


It may slow down the backtest.


Best regards,

Tomas

l
#7

Csaba

28.11.2019 20:06
Hi Tomas


Thank you for your tip! 
I will try it, this week is very busy, but thx again!


But the thing is, that I don't make the tests in visual mode >>> does it influence the speed, is it even a factor?


Brg: Csaba

h
#8

hankeys

29.11.2019 08:26
made a quick test and i dont see any difference between tick backtest by tick data sutire


verbose1, panel false - 16:02 minutes

verbose1, panel true - 15:40

verbose0, panel false - 15:36


so no difference whatever we set


slow tick backtest is mainly because of strategy itself - imagine, that you will have in strategy low value of "bars valid" - for example 1 - so the backtester need to do with every candle changes in pending orders, because of that the tick backtest in MT4 could last hours

TB
#9

Tomas Brynda

29.11.2019 08:45
Thanks for the comparison, Hankeys.


I know the backtest time strongly depends on a strategy logic, backtest times for different strategies vary a lot.

When running automated tests we always turn off the info panel just to make sure it won't slow down the backtests, but it looks like it has no significant impact.


Csaba, if you have some strategy that is ultra slow, please attach it here and I will check it.

We have improved the efficiency of calculation of many indicators, but there may be some hidden performance problem we haven't discovered yet.


If the strategy has a large amount of trades, that's most probably the cause of the slowdown. That is something we can't do anything about.


l
#10

Csaba

29.11.2019 11:40
Hi Hankeys and Tomas


Thank you both for the useful tips and infos! I will also make a small comparison in the next days.

I always work with strategies, they have appr. 300-400 trades / 16 years on H1, so I don't have so much trades. The BARS VALID value is also always minimum 25-30, it shouldn't be even a problem.


But anyway, I will check it also!


Brg, Csaba

Kc
#11

coensio

29.11.2019 19:13
Voted for this task.
TB
#12

Tomas Brynda

17.03.2020 16:07

Status changed from Waiting for information to Fixed

l
#13

Csaba

21.03.2020 14:40

Attachment Strategia 24346.sqx added

@Tomas Brynda

Sorry for the late answer. Of course I see, that you already fixed this problem (BIG THANK YOU!), I just wanted to send anyway a strategy that has extremely slow backtesting speed.
I use always TDS and I use always simulate SLIPPAGE and SIMULATE LIVE EXECUTION also.

Brg, Csaba
l
#14

Csaba

21.03.2020 23:23
------- UPDATE --------

I experienced today something very new.
I think, I know, why I had slow backtestings sometimes!

I just first let run an every tick test in the SQX. After that I exported the strategy, set Verbose = 0 and turned off display panel.
I started the MT4 and the backtesting with TDS.... This time was very slow.... 1 day.....

Then I turned off-on the PC. I just started the MT4 and nothing else was opened. I just shutted down all the charts and other small windows in the MT4 and just the strategy tester was opened.

Now it was very quick! It took just 15 min....


Strange... :)


Votes: +3

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please