MetaTrader 5 Strateji Test Cihazında Test Sonuçlarının Analizi ve Optimizasyon

 

Bir ve birkaç karakter üzerindeki testlerin sonuçlarını düşünün. Tüm onaylar modunda testler yapacağız. Sorunu yeniden oluşturmak ve sonuçlarınızı paylaşmak için çok sembollü Uzman Danışman şemalarınızı kullanabilirsiniz.

Problemi tanımlayalım. Örneğin bir karakter test edilirken test süresi 1 dakikadır. Başka bir karakter eklerken, test süresi beklendiği gibi 2 değil 4 dakikadır. Bir sembol daha eklersek (toplam 3), bir sembole göre test süresi zaten 8 kat artar ve bu böyle devam eder.

Testlerin aldığı zamanın hangi nedenle beklenene uymadığını bulmaya çalışalım. Sebeplerden biri, hesap geçmişiyle yanlış çalışma olabilir. Tüm geçmişi talep ederseniz, büyüdükçe bu, test süresini önemli ölçüde yavaşlatabilir. Bu durumda, testin başında harcanan zaman, testin sonunda harcanan zamandan önemli ölçüde farklı olacaktır. Bu, bir testte çok sayıda işlem olduğunda (birkaç on binlerce) çok belirgindir.

Yukarıda açıklanan durumla ilgili her şey doğru yapılırsa, sonuç aşağıdaki tabloda gösterildiği gibi olacaktır. Testin başlama saati sabittir ( 2017.01.01 ). Ardından, her test için zaman aralığını bir ay artırıyoruz. Mevcut ve önceki sonuçlar arasındaki fark (sütun Farkı ) yaklaşık olarak aynı olacaktır. Hesap geçmişindeki işlem sayısına bağlı değildir.

Testte, göstergelerin çalıştığı, koşulları kontrol etmek için çubuk ve gösterge verilerinin istendiği ve alım satım işlemlerinin gerçekleştirildiği bir Uzman Danışman kullanıldı.

 2018.01 . 27 18 : 10 : 50.318 Core 1   EURUSD,M5: 26169180 ticks, 74266 bars generated. Environment synchronized in 0 : 00 : 00.031 . Test passed in 0 : 00 : 36.641 (including ticks preprocessing 0 : 00 : 01.297 ).
2018.01 . 27 18 : 10 : 50.318 Core 1   EURUSD,M5: total time from login to stop testing 0 : 00 : 36.672 (including 0 : 00 : 00.031 for history data synchronization)
2018.01 . 27 18 : 10 : 50.318 Core 1    891 Mb memory used including 8 Mb of history data, 512 Mb of tick data

Bu durumda toplam test süresi 37 saniyedir. İki karakter kullanıldığında beklenen test süresi 37 sn. x 2 = 1 dak. 14 saniye Ve üç karakter için 37 sn. x 3 = 1 dak. 51 sn.

İki karakter için test sonuçları. Toplam test süresi 2 dk. 16 saniye


 2018.01 . 27 18 : 13 : 49.957 Core 1   EURUSD,M5: 26169180 ticks, 74266 bars generated. Environment synchronized in 0 : 00 : 00.031 . Test passed in 0 : 02 : 16.125 (including ticks preprocessing 0 : 00 : 01.344 ).
2018.01 . 27 18 : 13 : 49.957 Core 1   EURUSD,M5: total time from login to stop testing 0 : 02 : 16.156 (including 0 : 00 : 00.046 for history data synchronization)
2018.01 . 27 18 : 13 : 49.957 Core 1    53911219 total ticks for all symbols
2018.01 . 27 18 : 13 : 49.957 Core 1   EURUSD: passed to tester 26169180 ticks
2018.01 . 27 18 : 13 : 49.957 Core 1   GBPUSD: generate 27742039 ticks in 0 : 00 : 01.344 , passed to tester 27742039 ticks
2018.01 . 27 18 : 13 : 49.957 Core 1    1497 Mb memory used including 17 Mb of history data, 1024 Mb of tick data

Üç karakter için test sonuçları. Toplam test süresi 5 dk. 22 sn.


 2018.01 . 27 18 : 20 : 07.658 Core 1   EURUSD,M5: 26169180 ticks, 74266 bars generated. Environment synchronized in 0 : 00 : 00.062 . Test passed in 0 : 05 : 22.360 (including ticks preprocessing 0 : 00 : 03.547 ).
2018.01 . 27 18 : 20 : 07.658 Core 1   EURUSD,M5: total time from login to stop testing 0 : 05 : 22.422 (including 0 : 00 : 00.062 for history data synchronization)
2018.01 . 27 18 : 20 : 07.658 Core 1    86509916 total ticks for all symbols
2018.01 . 27 18 : 20 : 07.658 Core 1   EURUSD: passed to tester 26169180 ticks
2018.01 . 27 18 : 20 : 07.658 Core 1   GBPUSD: passed to tester 27742039 ticks
2018.01 . 27 18 : 20 : 07.658 Core 1   USDJPY: generate 32598697 ticks in 0 : 00 : 03.547 , passed to tester 32598697 ticks
2018.01 . 27 18 : 20 : 07.658 Core 1    2090 Mb memory used including 26 Mb of history data, 1472 Mb of cached tick data (total memory for tick data 1663 Mb)


 

Şimdi alım satım işlemlerinin testin süresini etkileyip etkilemediğini ve ne ölçüde etkilediğini bulmaya çalışalım. EA'da koşulları kontrol etmek ve anlaşmaları sonuçlandırmak için bloğu tamamen devre dışı bırakalım ve tekrar bir ve birkaç sembol için bir dizi test çalıştıralım. Gösterge tutamaçlarının alınmasını ve çubukların ve göstergelerin veri talebini bırakalım.

Bir karakter test edilirken, test süresi, veri yılı için önceki teste ( 2017.01.01 - 2018.01.01 ) kıyasla 13 saniye azaldı. İki karakter kullanıldığında beklenen test süresi 24 sn. x 2 = 48 sn. Ve üç karakter için 24 saniye. x 3 = 1 dak. 12 saniye


 2018.01 . 27 16 : 20 : 50.271 Core 1   EURUSD,M5: 26169180 ticks, 74266 bars generated. Environment synchronized in 0 : 00 : 00.047 . Test passed in 0 : 00 : 23.640 .
2018.01 . 27 16 : 20 : 50.271 Core 1   EURUSD,M5: total time from login to stop testing 0 : 00 : 23.687 (including 0 : 00 : 00.047 for history data synchronization)
2018.01 . 27 16 : 20 : 50.271 Core 1    823 Mb memory used including 8 Mb of history data, 512 Mb of tick data

İki sembolü test ederken, test süresi, veri yılı için önceki teste ( 2017.01.01 - 2018.01.01 ) kıyasla 31 saniye azaldı.


 2018.01 . 27 16 : 24 : 23.759 Core 1   EURUSD,M5: 26169180 ticks, 74266 bars generated. Environment synchronized in 0 : 00 : 00.047 . Test passed in 0 : 01 : 44.469 (including ticks preprocessing 0 : 00 : 01.422 ).
2018.01 . 27 16 : 24 : 23.759 Core 1   EURUSD,M5: total time from login to stop testing 0 : 01 : 44.516 (including 0 : 00 : 00.047 for history data synchronization)
2018.01 . 27 16 : 24 : 23.759 Core 1    53911219 total ticks for all symbols
2018.01 . 27 16 : 24 : 23.759 Core 1   EURUSD: passed to tester 26169180 ticks
2018.01 . 27 16 : 24 : 23.759 Core 1   GBPUSD: generate 27742039 ticks in 0 : 00 : 01.422 , passed to tester 27742039 ticks
2018.01 . 27 16 : 24 : 23.759 Core 1    1409 Mb memory used including 17 Mb of history data, 1024 Mb of tick data

Üç karakter test edilirken testin süresi 1 dakika azaldı. 7 saniye veri yılı için önceki teste göre ( 2017.01.01 – 2018.01.01 ).


 2018.01 . 27 16 : 30 : 07.790 Core 1   EURUSD,M5: 26169180 ticks, 74266 bars generated. Environment synchronized in 0 : 00 : 00.062 . Test passed in 0 : 04 : 21.141 (including ticks preprocessing 0 : 00 : 04.312 ).
2018.01 . 27 16 : 30 : 07.790 Core 1   EURUSD,M5: total time from login to stop testing 0 : 04 : 21.203 (including 0 : 00 : 00.062 for history data synchronization)
2018.01 . 27 16 : 30 : 07.790 Core 1    86509916 total ticks for all symbols
2018.01 . 27 16 : 30 : 07.790 Core 1   EURUSD: passed to tester 26169180 ticks
2018.01 . 27 16 : 30 : 07.790 Core 1   GBPUSD: passed to tester 27742039 ticks
2018.01 . 27 16 : 30 : 07.790 Core 1   USDJPY: generate 32598697 ticks in 0 : 00 : 04.312 , passed to tester 32598697 ticks
2018.01 . 27 16 : 30 : 07.790 Core 1    1863 Mb memory used including 26 Mb of history data, 1408 Mb of cached tick data (total memory for tick data 1663 Mb)

//---

Bu seride de beklenen test süresi karşılanmıyor.

 

Şimdi gösterge tutamaçlarını almak ve veri istemek için blokları devre dışı bırakmaya çalışalım. Aslında, şimdi sadece yeni bir çubuk oluşumu olayı için yalnızca bir koşulun kontrol edildiği sahte bir Uzman Danışman.

Bir karakter test edilirken, test süresi, veri yılı için önceki teste ( 2017.01.01 - 2018.01.01 ) kıyasla 8 saniye azaldı. İki karakter kullanıldığında beklenen test süresi 16 sn. x 2 = 32 sn. Üç karakter için 16 sn. x 3 = 48 sn. Dört karakter için 16 sn. x 4 = 1 dak. 4 sn.


 2018.01 . 27 17 : 49 : 39.855 Core 1   EURUSD,M5: 26169180 ticks, 74266 bars generated. Environment synchronized in 0 : 00 : 00.062 . Test passed in 0 : 00 : 16.438 (including ticks preprocessing 0 : 00 : 01.281 ).
2018.01 . 27 17 : 49 : 39.855 Core 1   EURUSD,M5: total time from login to stop testing 0 : 00 : 16.500 (including 0 : 00 : 00.062 for history data synchronization)
2018.01 . 27 17 : 49 : 39.855 Core 1    787 Mb memory used including 8 Mb of history data, 512 Mb of tick data

İki karakter test edilirken, testin süresi, veri yılı için önceki teste ( 2017.01.01 - 2018.01.01 ) kıyasla 40 saniye azaldı.


 2018.01 . 27 17 : 51 : 35.343 Core 1   EURUSD,M5: 26169180 ticks, 74266 bars generated. Environment synchronized in 0 : 00 : 00.032 . Test passed in 0 : 01 : 04.593 (including ticks preprocessing 0 : 00 : 01.359 ).
2018.01 . 27 17 : 51 : 35.343 Core 1   EURUSD,M5: total time from login to stop testing 0 : 01 : 04.625 (including 0 : 00 : 00.048 for history data synchronization)
2018.01 . 27 17 : 51 : 35.343 Core 1    53911219 total ticks for all symbols
2018.01 . 27 17 : 51 : 35.343 Core 1   EURUSD: passed to tester 26169180 ticks
2018.01 . 27 17 : 51 : 35.343 Core 1   GBPUSD: generate 27742039 ticks in 0 : 00 : 01.359 , passed to tester 27742039 ticks
2018.01 . 27 17 : 51 : 35.343 Core 1    1336 Mb memory used including 17 Mb of history data, 1024 Mb of tick data

Üç karakter test edilirken, test süresi, veri yılı için önceki teste ( 2017.01.01 - 2018.01.01 ) kıyasla 1 dakika 38 saniye azaldı.


 2018.01 . 27 17 : 55 : 00.938 Core 1   EURUSD,M5: 26169180 ticks, 74266 bars generated. Environment synchronized in 0 : 00 : 00.047 . Test passed in 0 : 02 : 41.000 (including ticks preprocessing 0 : 00 : 02.766 ).
2018.01 . 27 17 : 55 : 00.938 Core 1   EURUSD,M5: total time from login to stop testing 0 : 02 : 41.047 (including 0 : 00 : 00.063 for history data synchronization)
2018.01 . 27 17 : 55 : 00.938 Core 1    86509916 total ticks for all symbols
2018.01 . 27 17 : 55 : 00.938 Core 1   EURUSD: passed to tester 26169180 ticks
2018.01 . 27 17 : 55 : 00.938 Core 1   GBPUSD: passed to tester 27742039 ticks
2018.01 . 27 17 : 55 : 00.938 Core 1   USDJPY: generate 32598697 ticks in 0 : 00 : 02.766 , passed to tester 32598697 ticks
2018.01 . 27 17 : 55 : 00.938 Core 1    1892 Mb memory used including 26 Mb of history data, 1536 Mb of cached tick data (total memory for tick data 1663 Mb)

Veri yılı için dört karakter üzerinde başka bir test deneyelim ( 2017.01.01 - 2018.01.01 ).


 2018.01 . 27 18 : 00 : 24.607 Core 1   EURUSD,M5: 26169180 ticks, 74266 bars generated. Environment synchronized in 0 : 00 : 02.266 . Test passed in 0 : 04 : 30.140 (including ticks preprocessing 0 : 00 : 05.125 ).
2018.01 . 27 18 : 00 : 24.607 Core 1   EURUSD,M5: total time from login to stop testing 0 : 04 : 32.406 (including 0 : 00 : 02.375 for history data synchronization)
2018.01 . 27 18 : 00 : 24.607 Core 1    107227636 total ticks for all symbols
2018.01 . 27 18 : 00 : 24.607 Core 1   AUDUSD: generate 20717720 ticks in 0 : 00 : 05.125 , passed to tester 20717720 ticks
2018.01 . 27 18 : 00 : 24.607 Core 1   EURUSD: passed to tester 26169180 ticks
2018.01 . 27 18 : 00 : 24.607 Core 1   GBPUSD: passed to tester 27742039 ticks
2018.01 . 27 18 : 00 : 24.607 Core 1   USDJPY: passed to tester 32598697 ticks
2018.01 . 27 18 : 00 : 24.607 Core 1    1680 Mb memory used including 35 Mb of history data, 1280 Mb of cached tick data (total memory for tick data 2047 Mb)

//---

Bu seride de beklenen test süresi karşılanmıyor.

 

Soru:

MQL'de böyle bir çok sembollü Uzman Danışman şeması oluşturmak, böylece teste semboller eklerken testlerin süresinin birçok kez artmaması mümkün müdür?

//---

Bu mümkün değilse, terminal geliştiricileri için seçeneklerden biri, tüm karakterleri aynı anda değil, sırayla karakter karakter test edebileceğiniz başka bir mod eklemektir. Bu, sonuç olarak beklenen test süresini verecektir. Mesele şu ki, çok sembollü Uzman Danışmanlar çok sık olarak sadece şu durumlarda kullanılır:

  1. Test için daha fazla veri gerekiyor.
  2. Alım satım algoritmasını aynı parametrelerle çok çeşitli fiyat hareketleri, koşullar (spread, stop/limit seviyeleri) vb. üzerinde test edin.

Bu gibi durumlarda, testlerin süresini ve parametrelerin optimizasyonunu önemli ölçüde azaltacak yeni bir moda ihtiyaç vardır. Ve son test için tüm sembolleri aynı anda test edin.

 

danışman

 #include <TesterBenchmark.mqh> // https://www.mql5.com/ru/code/18804

input int AmountSymbols = 1 ;

double Sum2 = 0 ;
const bool Init = EventSetTimer ( 1 );

double GetBid( const string Symb )
{
   static MqlTick Tick;      

   return ( SymbolInfoTick (Symb, Tick) ? Tick.bid : 0 );
}

void OnTimer ()
{
   static const string Symbols[] = { "EURUSD" , "GBPUSD" , "AUDUSD" };
  
   for ( int i = 0 ; i < AmountSymbols; i++)    
    Sum2 += GetBid(Symbols[i]);
}

void OnTick ()
{
}

void OnDeinit ( const int )
{
   Print (Sum2);
}

EURUSD M1 MetaQuotes-Demo, Hedge, USD, gecikme yok, yalnızca Core1 aracısı, gerçek keneler 09/01/2017 - 01/26/2018.


bir karakter

i = 0 Pass = 0 OnTester = 3.728 s.: Count = 9753093 , 2616173.0 unit/sec, Agent = C:\Program Files\Alpari Limited MT5\Tester\Agent- 127.0 . 0.1 - 3000 build = 1755
i = 1 Pass = 1 OnTester = 3.727 s .: Count = 9753093 , 2616875.0 unit/sec, Agent = C:\Program Files\Alpari Limited MT5\Tester\Agent- 127.0 . 0.1 - 3000 build = 1755


iki karakter

i = 0 Pass = 0 OnTester = 7.946 s.: Count = 9753093 , 1227421.7 unit/sec, Agent = C:\Program Files\Alpari Limited MT5\Tester\Agent- 127.0 . 0.1 - 3000 build = 1755
i = 1 Pass = 1 OnTester = 7.614 s .: Count = 9753093 , 1280942.1 unit/sec, Agent = C:\Program Files\Alpari Limited MT5\Tester\Agent- 127.0 . 0.1 - 3000 build = 1755


üç karakter

i = 0 Pass = 0 OnTester = 10.300 s.: Count = 9753093 , 946902.2 unit/sec, Agent = C:\Program Files\Alpari Limited MT5\Tester\Agent- 127.0 . 0.1 - 3000 build = 1755
i = 1 Pass = 1 OnTester = 10.236 s .: Count = 9753093 , 952822.7 unit/sec, Agent = C:\Program Files\Alpari Limited MT5\Tester\Agent- 127.0 . 0.1 - 3000 build = 1755


Ölçeklenebilirlik konusunda her şey yolunda gibi görünüyor.

 
fxsaber :

...

Ölçeklenebilirlik konusunda her şey yolunda gibi görünüyor.

Tüm tiklerin geldiği bir uzmana ihtiyacınız var. Her bir semboldeki göstergelerden gelen özel olaylar aracılığıyla.

Ticaret, otomatik ticaret sistemleri ve ticaret stratejilerinin test edilmesi hakkında forum

MT5'te çoklu para birimi testi

fxsaber , 2016.11.13 14:04

Önemli olan OnTick çağrısında. Çoklu para birimi danışmanları için yalnızca iki doğru yazım vardır (ikincisi hatalıdır)

  1. Çok Para Birimi OnTick. Başlangıçta her sembol için bir gösterge gönderilerek gerçekleştirilir. Göstergenin OnCalculate'e özel bir Olay gönderdiği yer. Ve EA'nın kendisinde, OnChartEvent'te tüm göstergelerden özel Olaylar yakalanır ve ticaret mantığı yürütülür. Böyle bir Uzman Danışmanda standart bir OnTick yoktur.
  2. ...


 

Göstergeyi \MQL5\Indicators içine yerleştirin

 //+------------------------------------------------------------------+
//|                                            EventsSpyTickOnly.mq5 |
//|                        Copyright 2018, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "2018, MetaQuotes Software Corp."
#property link        "http://www.mql5.com"
//---
#property indicator_chart_window
#property indicator_plots 0
//+------------------------------------------------------------------+
//| Перечисление событий                                             |
//+------------------------------------------------------------------+
enum ENUM_CHART_EVENT_SYMBOL
  {
   CHARTEVENT_INIT = 0 ,         // Событие "инициализация" 
   CHARTEVENT_NO   = 0 ,         // События отключены
   CHARTEVENT_TICK = 0x00200000 // Событие "новый тик"
  };
//--- Внешние параметры
input long                     chart_id;                 // идентификатор графика-получателя события
input ushort                   custom_event_id;           // идентификатор события  
input ENUM_CHART_EVENT_SYMBOL flag_event=CHARTEVENT_NO; // флаг, определяющий тип события.
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate ( const int rates_total,
                 const int prev_calculated,
                 const int begin,
                 const double & price[])

  {
   if (prev_calculated== 0 )
     {
      EventCustom(CHARTEVENT_INIT);
       return (rates_total);
     }
//--- New tick
   if (flag_event==CHARTEVENT_TICK)
      EventCustom(CHARTEVENT_TICK);
//--- Return value of prev_calculated for next call
   return (rates_total);
  }
//+------------------------------------------------------------------+
//| Пользовательское событие                                         |
//+------------------------------------------------------------------+
void EventCustom(ENUM_CHART_EVENT_SYMBOL event)
  {
   EventChartCustom (chart_id,custom_event_id,( long )event, 0.0 , _Symbol );
  }
//+------------------------------------------------------------------+
 

Test Uzmanı:

 //+------------------------------------------------------------------+
//|                                                         Test.mq5 |
//|                        Copyright 2018, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "2018, MetaQuotes Software Corp."
#property link        "http://www.mql5.com"
//+------------------------------------------------------------------+
//| Перечисление событий                                             |
//+------------------------------------------------------------------+
enum ENUM_CHART_EVENT_SYMBOL
  {
   CHARTEVENT_INIT = 0 ,         // Событие "инициализация" 
   CHARTEVENT_NO   = 0 ,         // События отключены
   CHARTEVENT_TICK = 0x00200000 // Событие "новый тик"
  };
//--- Внешние параметры
input int AmountSymbols= 1 ;
//---
static const string symbols[]={ "EURUSD" , "GBPUSD" , "AUDUSD" , "USDJPY" , "USDCAD" };
long spy_indicator_handles[];
//---
double      sum2 = 0 ;
const bool init = EventSetTimer ( 1 );
//+------------------------------------------------------------------+ 
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit ( void )
  {
   GetSpyHandles();
   return ( INIT_SUCCEEDED );
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit ( const int )
  {
   Print (sum2);
  }
//+------------------------------------------------------------------+
//| Timer function                                                   |
//+------------------------------------------------------------------+
void OnTimer ( void )
  {
   //Strategy();
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick ( void )
  {
   //Strategy();
  }
//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent ( const int     id,
                   const long    &lparam,
                   const double &dparam,
                   const string &sparam)
  {
//--- Если было событие "тик"
   if (lparam==CHARTEVENT_TICK)
     {
      Strategy();
       return ;
     }
  }
//+------------------------------------------------------------------+
//| Get bid price                                                    |
//+------------------------------------------------------------------+
double GetBid( const string Symb)
  {
   static MqlTick Tick;
   return ( SymbolInfoTick (Symb, Tick)? Tick.bid : 0 );
  }
//+------------------------------------------------------------------+
//| Strategy                                                         |
//+------------------------------------------------------------------+
void Strategy( void )
  {
   for ( int i= 0 ; i<AmountSymbols; i++)
      sum2+=GetBid(symbols[i]);
  }
//+------------------------------------------------------------------+
//| Получает хэндлы агентов по указанным символам                    |
//+------------------------------------------------------------------+
void GetSpyHandles( void )
  {
   string path= "EventsSpyTickOnly.ex5" ;
//---
   :: ArrayResize (spy_indicator_handles,AmountSymbols);
//--- Пройдемся по всем символам
   for ( int s= 0 ; s<AmountSymbols; s++)
     {
       //--- Получим хэндл индикатора
      spy_indicator_handles[s]=:: iCustom (symbols[s],:: Period (),path,:: ChartID (), 0 ,CHARTEVENT_TICK);
       //--- Если не удалось получить хэндл индикатора
       if (spy_indicator_handles[s]== INVALID_HANDLE )
         :: Print ( "Failed to install agent on " +symbols[s]+ "" );
     }
  }
//+------------------------------------------------------------------+
 

Sonuçlar.

1 karakter:

 2018.01 . 28 11 : 10 : 29.325 Core 1   EURUSD,M5 (MetaQuotes-Demo): every tick generating
2018.01 . 28 11 : 10 : 29.325 Core 1   EURUSD,M5: testing of Experts\Test.ex5 from 2017.01 . 01 00 : 00 to 2018.01 . 01 00 : 00 started with inputs:
2018.01 . 28 11 : 10 : 29.325 Core 1     AmountSymbols= 1

2018.01 . 28 11 : 10 : 49.279 Core 1   final balance 10000.00 USD
2018.01 . 28 11 : 10 : 49.279 Core 1    2017.12 . 29 23 : 59 : 59    64793248.54125572
2018.01 . 28 11 : 10 : 49.279 Core 1   EURUSD,M5: 26169180 ticks, 74266 bars generated. Environment synchronized in 0 : 00 : 00.032 . Test passed in 0 : 00 : 26.015 .
2018.01 . 28 11 : 10 : 49.279 Core 1   EURUSD,M5: total time from login to stop testing 0 : 00 : 26.047 (including 0 : 00 : 00.032 for history data synchronization)
2018.01 . 28 11 : 10 : 49.279 Core 1    778 Mb memory used including 8 Mb of history data, 512 Mb of tick data

2 karakter:

 2018.01 . 28 11 : 11 : 49.343 Core 1   EURUSD,M5 (MetaQuotes-Demo): every tick generating
2018.01 . 28 11 : 11 : 49.343 Core 1   EURUSD,M5: testing of Experts\Test.ex5 from 2017.01 . 01 00 : 00 to 2018.01 . 01 00 : 00 started with inputs:
2018.01 . 28 11 : 11 : 49.343 Core 1     AmountSymbols= 2

2018.01 . 28 11 : 13 : 18.421 Core 1   final balance 10000.00 USD
2018.01 . 28 11 : 13 : 18.421 Core 1    2017.12 . 29 23 : 59 : 59    411044644.6801022
2018.01 . 28 11 : 13 : 18.421 Core 1   EURUSD,M5: 26169180 ticks, 74266 bars generated. Environment synchronized in 0 : 00 : 00.032 . Test passed in 0 : 01 : 35.203 (including ticks preprocessing 0 : 00 : 01.360 ).
2018.01 . 28 11 : 13 : 18.421 Core 1   EURUSD,M5: total time from login to stop testing 0 : 01 : 35.235 (including 0 : 00 : 00.047 for history data synchronization)
2018.01 . 28 11 : 13 : 18.421 Core 1    53911219 total ticks for all symbols
2018.01 . 28 11 : 13 : 18.421 Core 1   EURUSD: passed to tester 26169180 ticks
2018.01 . 28 11 : 13 : 18.421 Core 1   GBPUSD: generate 27742039 ticks in 0 : 00 : 01.360 , passed to tester 27742039 ticks
2018.01 . 28 11 : 13 : 18.421 Core 1    1330 Mb memory used including 17 Mb of history data, 1024 Mb of tick data

3 karakter:

 2018.01 . 28 11 : 14 : 27.847 Core 1   EURUSD,M5 (MetaQuotes-Demo): every tick generating
2018.01 . 28 11 : 14 : 27.847 Core 1   EURUSD,M5: testing of Experts\Test.ex5 from 2017.01 . 01 00 : 00 to 2018.01 . 01 00 : 00 started with inputs:
2018.01 . 28 11 : 14 : 27.847 Core 1     AmountSymbols= 3

2018.01 . 28 11 : 17 : 43.325 Core 1   final balance 10000.00 USD
2018.01 . 28 11 : 17 : 43.325 Core 1    2017.12 . 29 23 : 59 : 59    1009249102.577681
2018.01 . 28 11 : 17 : 43.325 Core 1   EURUSD,M5: 26169180 ticks, 74266 bars generated. Environment synchronized in 0 : 00 : 00.047 . Test passed in 0 : 03 : 21.750 (including ticks preprocessing 0 : 00 : 01.047 ).
2018.01 . 28 11 : 17 : 43.325 Core 1   EURUSD,M5: total time from login to stop testing 0 : 03 : 21.797 (including 0 : 00 : 00.156 for history data synchronization)
2018.01 . 28 11 : 17 : 43.325 Core 1    74628939 total ticks for all symbols
2018.01 . 28 11 : 17 : 43.325 Core 1   AUDUSD: generate 20717720 ticks in 0 : 00 : 01.047 , passed to tester 20717720 ticks
2018.01 . 28 11 : 17 : 43.325 Core 1   EURUSD: passed to tester 26169180 ticks
2018.01 . 28 11 : 17 : 43.325 Core 1   GBPUSD: passed to tester 27742039 ticks
2018.01 . 28 11 : 17 : 43.325 Core 1    1750 Mb memory used including 26 Mb of history data, 1408 Mb of tick data

4 karakter:

 2018.01 . 28 11 : 19 : 02.758 Core 1   EURUSD,M5 (MetaQuotes-Demo): every tick generating
2018.01 . 28 11 : 19 : 02.758 Core 1   EURUSD,M5: testing of Experts\Test.ex5 from 2017.01 . 01 00 : 00 to 2018.01 . 01 00 : 00 started with inputs:
2018.01 . 28 11 : 19 : 02.758 Core 1     AmountSymbols= 4

2018.01 . 28 11 : 25 : 57.059 Core 1   final balance 10000.00 USD
2018.01 . 28 11 : 25 : 57.059 Core 1    2017.12 . 29 23 : 59 : 59    63985236406.09325
2018.01 . 28 11 : 25 : 57.059 Core 1   EURUSD,M5: 26169180 ticks, 74266 bars generated. Environment synchronized in 0 : 00 : 00.078 . Test passed in 0 : 07 : 00.531 (including ticks preprocessing 0 : 00 : 06.719 ).
2018.01 . 28 11 : 25 : 57.059 Core 1   EURUSD,M5: total time from login to stop testing 0 : 07 : 00.609 (including 0 : 00 : 00.078 for history data synchronization)
2018.01 . 28 11 : 25 : 57.059 Core 1    107227636 total ticks for all symbols
2018.01 . 28 11 : 25 : 57.059 Core 1   AUDUSD: passed to tester 20717720 ticks
2018.01 . 28 11 : 25 : 57.059 Core 1   EURUSD: passed to tester 26169180 ticks
2018.01 . 28 11 : 25 : 57.059 Core 1   GBPUSD: passed to tester 27742039 ticks
2018.01 . 28 11 : 25 : 57.059 Core 1   USDJPY: generate 32598697 ticks in 0 : 00 : 06.719 , passed to tester 32598697 ticks
2018.01 . 28 11 : 25 : 57.059 Core 1    1985 Mb memory used including 35 Mb of history data, 1600 Mb of cached tick data (total memory for tick data 2047 Mb)

5 karakter:

 2018.01 . 28 11 : 27 : 00.683 Core 1   EURUSD,M5 (MetaQuotes-Demo): every tick generating
2018.01 . 28 11 : 27 : 00.683 Core 1   EURUSD,M5: testing of Experts\Test.ex5 from 2017.01 . 01 00 : 00 to 2018.01 . 01 00 : 00 started with inputs:
2018.01 . 28 11 : 27 : 00.683 Core 1     AmountSymbols= 5

2018.01 . 28 11 : 38 : 47.355 Core 1   final balance 10000.00 USD
2018.01 . 28 11 : 38 : 47.355 Core 1    2017.12 . 29 23 : 59 : 59    94559190795.58774
2018.01 . 28 11 : 38 : 47.355 Core 1   EURUSD,M5: 26169180 ticks, 74266 bars generated. Environment synchronized in 0 : 00 : 00.266 . Test passed in 0 : 11 : 54.015 (including ticks preprocessing 0 : 00 : 08.734 ).
2018.01 . 28 11 : 38 : 47.355 Core 1   EURUSD,M5: total time from login to stop testing 0 : 11 : 54.281 (including 0 : 00 : 00.500 for history data synchronization)
2018.01 . 28 11 : 38 : 47.355 Core 1    130637614 total ticks for all symbols
2018.01 . 28 11 : 38 : 47.355 Core 1   AUDUSD: generate 20717720 ticks in 0 : 00 : 01.078 , passed to tester 20717720 ticks
2018.01 . 28 11 : 38 : 47.355 Core 1   EURUSD: generate 26169180 ticks in 0 : 00 : 01.281 , passed to tester 26169180 ticks
2018.01 . 28 11 : 38 : 47.355 Core 1   GBPUSD: generate 27742039 ticks in 0 : 00 : 01.406 , passed to tester 27742039 ticks
2018.01 . 28 11 : 38 : 47.355 Core 1   USDCAD: generate 23409978 ticks in 0 : 00 : 01.188 , passed to tester 23409978 ticks
2018.01 . 28 11 : 38 : 47.355 Core 1   USDJPY: generate 32598697 ticks in 0 : 00 : 03.781 , passed to tester 32598697 ticks
2018.01 . 28 11 : 38 : 47.355 Core 1    2735 Mb memory used including 44 Mb of history data, 2304 Mb of cached tick data (total memory for tick data 2495 Mb)
 
Henüz başlatmadım, ancak görünen o ki, yeterince adanmış

Ticaret, otomatik ticaret sistemleri ve ticaret stratejilerinin test edilmesi hakkında forum

MetaTrader 5 Strateji Test Cihazında Test Sonuçlarının Analizi ve Optimizasyon

Anatoli Kazharski , 2018.01.28 09:09

Test Uzmanı:

 void OnChartEvent ( const int     id,
                   const long    &lparam,
                   const double &dparam,
                   const string &sparam)
  {
//--- Если было событие "тик"
   if (lparam==CHARTEVENT_TICK + CHARTEVENT_CUSTOM )
     {
      Strategy();
       return ;
     }
  }
 
fxsaber :
Henüz başlatmadım, ancak görünen o ki, yeterince adanmış

Uzun parametre (lparam) kontrol edilir. Kene olay kimliği içinde bulunur.

Kullanıcı olay kimliği (int kimliği) sıfırdır.

Bunu daha net hale getirmek için yapabilirsiniz:

 //+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent ( const int     id,
                   const long    &lparam,
                   const double &dparam,
                   const string &sparam)
  {
//--- Если было пользовательское событие
   if (id>= CHARTEVENT_CUSTOM )
     {
       //--- Если было событие "тик"
       if (lparam==CHARTEVENT_TICK)
        {
         Strategy();
         return ;
        }
       return ;
     }
  }
Neden: