Analysis of test results and optimisation in the MetaTrader 5 strategy tester - page 5

 
Anatoli Kazharski:

The same thing that is being done now. Load the symbols during the test process.

Or immediately before the start of the test, define and append to the selected symbols for the test in the list, if such a list would exist. Alternatively, if determined that the symbols that are in the cache are no longer needed, then don't use them in the test.

I can not have a definite answer in any case, but only at the level of assumptions and suggestions of options.

Ok.

Expert does not trade. But as it seems to check possibility of entering the market, one more pair is loaded additionally to the main one for calculating margin requirements. Data on two pairs are cached so that no time is lost in unpacking and preparing data during the next test.

The Expert Advisor starts to trade. The second missing pair is loaded to calculate the profit. These data are cached again, so that no time is lost in decompressing and preparing the data during the next test.

Personally, you don't like to waste time on "unnecessary" application of ticks to the history. Others will strongly dislike losing much more time in the re-extraction and preparation of the data.

OK, you answer. Why not, as long as there is no request, apply "superfluous" tools ticks? "Good question" (ts) And by this moment, the moment of request, you have to build history, (and moreover to have ticks, because someone can request them too). The time loss will be even greater than if we gradually build the history (as we are building it now).

There's no guarantee that an expert who uses a particular story won't use that story on other passes. 99 percent chance that the story on subsequent passes will be the same as the one used on previous passes

 
I agree with Slava - the example is spherical.
 
Slava:

Ok.

Expert Advisor does not trade. But due to the fact that it seems to check possibility of entering the market, one more pair is loaded additionally to the main pair for calculating margin requirements. Data on two pairs are cached so that no time is lost in unpacking and preparing data during the next test.

The Expert Advisor starts to trade. The second missing pair is loaded to calculate the profit. These data are cached again, so that no time is lost in decompressing and preparing the data during the next test.

Personally, you don't like to waste time on "unnecessary" application of ticks to the history. Everyone else strongly dislikes losing much more time on reunpacking and preparing the data.

OK, you answer. Why not, as long as there is no request, apply "superfluous" tools ticks? "Good question" (ts) And by this moment, the moment of query, you have to build history, (and moreover to have ticks, because someone may request them too). The time loss will be even greater than if we gradually build the history (as we are building it now).

You cannot reliably predict that the Expert Advisor using some history will not use the same history on other passes. 99% chance that the history used in subsequent passes of testing will be the same as the one used in previous passes

I don't really insist. You could have started right away with this clarification. If you know for sure that your option is the best, then you can save time without wasting time discussing it. But a clarification is needed, if I may, as I'm not sure I've been understood.

Is all this clarification about the optimisation process?

What if it's just about the single test process? Why ticks from GBPUSD and AUDUSD from previous tests when only EURUSD is being tested ?

I simply do not see in what case we may need ticks of other symbols (GBPUSD and AUDUSD), when only one symbol (EURUSD) is needed. Need some specific examples and figures.

What if I've tested 20 symbols at a time before? Why do I need ticks from all of these symbols if I only need to test one? The more characters used in the previous single test, the longer it will take to test on just one. I can, after all, switch to character tests from a completely different character group. And I don't need the data from the previous character group at all right now.

And what kind of time are we talking about (unpacking/preparing)? How long does it take to unpack and prepare the data? And how much time increases for a single test after a multisymbol test?

I'll run the tests now and show you the results. I need clarification regarding a specific example.

 
Anatoli Kazharski:
The "Reset caches" checkbox is missing.
 

1 symbol: EURUSD

2018.01.29 19:30:33.875 Core 1  EURUSD,M5: 26169180 ticks, 74266 bars generated. Environment synchronized in 0:00:00.078. Test passed in 0:00:27.266 (including ticks preprocessing 0:00:01.282).
2018.01.29 19:30:33.875 Core 1  EURUSD,M5: total time from login to stop testing 0:00:27.344 (including 0:00:00.078 for history data synchronization)
2018.01.29 19:30:33.875 Core 1  837 Mb memory used including 8 Mb of history data, 512 Mb of tick data

//---

5 symbols: EURUSD,GBPUSD,USDJPY,AUDUSD,USDCAD

2018.01.29 19:59:39.750 Core 1  EURUSD,M5: 26169180 ticks, 74266 bars generated. Environment synchronized in 0:00:00.078. Test passed in 0:11:52.156.
2018.01.29 19:59:39.750 Core 1  EURUSD,M5: total time from login to stop testing 0:11:52.234 (including 0:00:00.078 for history data synchronization)
2018.01.29 19:59:39.750 Core 1  130637614 total ticks for all symbols
2018.01.29 19:59:39.750 Core 1  AUDUSD: passed to tester 20717720 ticks
2018.01.29 19:59:39.750 Core 1  EURUSD: passed to tester 26169180 ticks
2018.01.29 19:59:39.750 Core 1  GBPUSD: passed to tester 27742039 ticks
2018.01.29 19:59:39.750 Core 1  USDCAD: passed to tester 23409978 ticks
2018.01.29 19:59:39.750 Core 1  USDJPY: passed to tester 32598697 ticks
2018.01.29 19:59:39.750 Core 1  1574 Mb memory used including 44 Mb of history data, 1088 Mb of cached tick data (total memory for tick data 2495 Mb)

//---

Now we need to test again on a single symbol.

1 symbol: EURUSD

2018.01.29 20:04:25.737 Core 1  EURUSD,M5: 26169180 ticks, 74266 bars generated. Environment synchronized in 0:00:00.078. Test passed in 0:01:34.203.
2018.01.29 20:04:25.737 Core 1  EURUSD,M5: total time from login to stop testing 0:01:34.281 (including 0:00:00.078 for history data synchronization)
2018.01.29 20:04:25.737 Core 1  130637614 total ticks for all symbols
2018.01.29 20:04:25.737 Core 1  AUDUSD: passed to tester 20717720 ticks
2018.01.29 20:04:25.737 Core 1  EURUSD: passed to tester 26169180 ticks
2018.01.29 20:04:25.737 Core 1  GBPUSD: passed to tester 27742039 ticks
2018.01.29 20:04:25.737 Core 1  USDCAD: passed to tester 23409978 ticks
2018.01.29 20:04:25.737 Core 1  USDJPY: passed to tester 32598697 ticks
2018.01.29 20:04:25.737 Core 1  1288 Mb memory used including 44 Mb of history data, 1024 Mb of cached tick data (total memory for tick data 2495 Mb)

//---

In this case, why do we need ticks of these symbols? Because of this extra load, the test time on one symbol has increased by more than 3 times. The time range is one year. What if I needed to run a test on 5 years?

 
fxsaber:
The "Reset caches" checkbox is missing.
It may be possible to do without the check box at all. It just needs to be found.
 
fxsaber:
The "Reset caches" checkbox is missing.

We had such a (similar) tick in four. We removed it. Because there was a misunderstanding by the bulk of users and a lot of questions.

 
Slava:

We had such a (similar) tick in four. We removed it. As there was a misunderstanding amongst the bulk of users and many questions.

There is always terminal.ini:)
 

Three posts will be published next:

  1. How long does one EA test in the strategy tester last?
  2. How long does it take to optimise parameters on a computer?
  3. How long does it take to optimise parameters in the cloud?

I will use my own Expert Advisor for the tests. You can run the same series of tests and present your results. In my case, I get several dozens of thousands of deals during 1 year.


1. How long is one test of an Expert Advisor in the strategy tester?

Let us have the test results in theOpen price only mode as an example.M5 timeframe (five-minute data). Account typeHedge. Time frame one year(2017.01.01-2018.01. 01).

Symbol: EURUSD

EURUSD,M5: 281877 ticks, 74300 bars generated. Test passed in 0:00:01.453.
282883 total ticks for all symbols
EURUSD: passed to tester 282883 ticks
466 Mb memory used including 8 Mb of history data, 64 Mb of tick data

According to the results of the test above, we can see that the test on one symbol lasts1-1.5 seconds for a period of one year.

Now let's try to test a currency pair with no account currency. For example, if your account is in USD, then for the test let's take a symbol that doesn't have USD. For example, EURCHF. The reason is that for correct calculations of margin requirements and profits in this case the test will use symbols EURUSD and USDCHF, and this in turn increases the test time.

Symbol: EURCHF

EURCHF,M5: 281063 ticks, 74273 bars generated. Test passed in 0:00:01.860.
846826 total ticks for all symbols
EURCHF: passed to tester 282468 ticks
EURUSD: passed to tester 282883 ticks
USDCHF: passed to tester 281475 ticks
467 Mb memory used including 8 Mb of history data, 64 Mb of tick data

As we can see, the test for cross rates will be approximately twice as long. In this case the test took1.5-2 seconds. Now let's try to test it on several symbols.

Symbols: EURUSD,GBPUSD,USDJPY

EURUSD,M5: 282881 ticks, 74300 bars generated. Environment synchronized in 0:00:00.031. Test passed in 0:00:07.172.
EURUSD,M5: total time from login to stop testing 0:00:07.203 (including 0:00:00.031 for history data synchronization)
853054 total ticks for all symbols
EURUSD: passed to tester 282883 ticks
GBPUSD: passed to tester 285067 ticks
USDJPY: passed to tester 285104 ticks
628 Mb memory used including 26 Mb of history data, 64 Mb of tick data

Symbols: EURCHF,AUDCAD,AUDNZD

EURCHF,M5: 282465 ticks, 74273 bars generated. Environment synchronized in 0:00:00.031. Test passed in 0:00:12.109.
EURCHF,M5: total time from login to stop testing 0:00:12.140 (including 0:00:00.031 for history data synchronization)
2264405 total ticks for all symbols
AUDCAD: passed to tester 284995 ticks
AUDNZD: passed to tester 285398 ticks
AUDUSD: passed to tester 282069 ticks
EURCHF: passed to tester 282468 ticks
EURUSD: passed to tester 282883 ticks
NZDUSD: passed to tester 282153 ticks
USDCAD: passed to tester 282964 ticks
USDCHF: passed to tester 281475 ticks
854 Mb memory used including 26 Mb of history data, 192 Mb of tick data

When testing multiple symbols, the test speed slows down. Unfortunately, it is not possible to do it differently now, without losing the accuracy of the tests. But, as mentioned earlier, in the next update the developers of the terminal will expand the capabilities of MQL5, adding the ability to perform multi-symbol tests much faster.

Тестирование стратегий - Алгоритмический трейдинг, торговые роботы - MetaTrader 5
Тестирование стратегий - Алгоритмический трейдинг, торговые роботы - MetaTrader 5
  • www.metatrader5.com
Тестер стратегий позволяет тестировать и оптимизировать торговые стратегии (советники) перед началом использования их в реальной торговле. При тестировании советника происходит его однократная прогонка с начальными параметрами на исторических данных. При оптимизации торговая стратегия прогоняется несколько раз с различным набором параметров...
 

2. How long does it take to optimize parameters on my computer?

As an example, let's try to optimise the parameters onAlpari broker's data on different symbols inOpen price only mode.M5 timeframe (five minutes data).Hedge account type. Time frame one year(2017.01.01-2018.01. 01).

Symbol: EURUSD

result cache used 7953 times
genetic optimization finished on pass 15616 (of 504330836375520000)
optimization done in 28 minutes 56 seconds
local 7663 tasks (100%), remote 0 tasks (0%), cloud 0 tasks (0%)

Symbol: EURCHF

result cache used 2507 times
genetic optimization finished on pass 8704 (of 504330836375520000)
optimization done in 32 minutes 50 seconds
local 6197 tasks (100%), remote 0 tasks (0%), cloud 0 tasks (0%)

Symbols: EURUSD,GBPUSD,USDJPY

result cache used 9892 times
genetic optimization finished on pass 18176 (of 504330836375520000)
optimization done in 2 hours 15 minutes 03 seconds
local 8284 tasks (100%), remote 0 tasks (0%), cloud 0 tasks (0%)

Symbols: EURCHF,AUDCAD,AUDNZD

result cache used 7281 times
genetic optimization finished on pass 13312 (of 504330836375520000)
optimization done in 3 hours 13 minutes 37 seconds
local 6031 tasks (100%), remote 0 tasks (0%), cloud 0 tasks (0%)

In the near future, theMetaTrader 5 terminal will be updated, and the speed of testing and optimization will be much faster. Perhaps then it will be possible to conduct the optimization even in theAll ticks mode. In addition, using theMQL5 Cloud Network service will become more profitable, as the speed of optimization will increase.

Распределенные вычисления в сети MQL5 Cloud Network
Распределенные вычисления в сети MQL5 Cloud Network
  • cloud.mql5.com
Большую часть времени современные компьютеры простаивают и не используют всех возможностей процессора. Мы предлагаем задействовать их с пользой. Вы можете сдавать мощности вашего компьютера другим участникам нашей сети для выполнения разнообразных...