Librerie: SingoloTesterCache - pagina 3

 

2 problema.

Print(SingleTesterCache.Summary.ToString()) comando;

L'ho testato in altri Expert Advisor e così via, ma fornisce alcune statistiche errate.

variante 1

LO      0       23:58:34.935    Core 1  2020.12.29 23:59:59   bars = 0
FF      0       23:58:34.935    Core 1  2020.12.29 23:59:59   ticks = 0
JP      0       23:58:34.935    Core 1  2020.12.29 23:59:59   symbol =  
CE      0       23:58:34.935    Core 1  2020.12.29 23:59:59   initial_deposit = 0.0
EP      0       23:58:34.935    Core 1  2020.12.29 23:59:59   withdrawal = 0.0
HH      0       23:58:34.935    Core 1  2020.12.29 23:59:59   profit = 0.0
HN      0       23:58:34.935    Core 1  2020.12.29 23:59:59   grossprofit = 0.0
GG      0       23:58:34.935    Core 1  2020.12.29 23:59:59   grossloss = 0.0
RN      0       23:58:34.935    Core 1  2020.12.29 23:59:59   maxprofit = 0.0
HH      0       23:58:34.935    Core 1  2020.12.29 23:59:59   minprofit = 2.121995791459338 e-314
RO      0       23:58:34.935    Core 1  2020.12.29 23:59:59   conprofitmax = 1.22485
IK      0       23:58:34.935    Core 1  2020.12.29 23:59:59   maxconprofit = 2.659058588082234 e-312
CD      0       23:58:34.935    Core 1  2020.12.29 23:59:59   conlossmax = 6.951846319652696 e-310
CP      0       23:58:34.935    Core 1  2020.12.29 23:59:59   maxconloss = 0.0
FK      0       23:58:34.935    Core 1  2020.12.29 23:59:59   balance_min = 1.778636325028488 e-322
OM      0       23:58:34.935    Core 1  2020.12.29 23:59:59   maxdrawdown = 6.951582466168817 e-310
OS      0       23:58:34.935    Core 1  2020.12.29 23:59:59   drawdownpercent = 6.951844503800728 e-310
CH      0       23:58:34.935    Core 1  2020.12.29 23:59:59   reldrawdown = 3.458459520888726 e-323
NS      0       23:58:34.935    Core 1  2020.12.29 23:59:59   reldrawdownpercent = -nan
RI      0       23:58:34.935    Core 1  2020.12.29 23:59:59   equity_min = 4.120368567481494 e-310
NE      0       23:58:34.935    Core 1  2020.12.29 23:59:59   maxdrawdown_e = 0.0
OM      0       23:58:34.935    Core 1  2020.12.29 23:59:59   drawdownpercent_e = 0.0
PK      0       23:58:34.935    Core 1  2020.12.29 23:59:59   reldrawdown_e = 2.659058580572436 e-312
GO      0       23:58:34.935    Core 1  2020.12.29 23:59:59   reldrawdownpercnt_e = 4.450572116172598 e-308
GS      0       23:58:34.935    Core 1  2020.12.29 23:59:59   expected_payoff = 9.758620965830218 e-312
DD      0       23:58:34.935    Core 1  2020.12.29 23:59:59   profit_factor = 6.641883604895093 e-310
IG      0       23:58:34.935    Core 1  2020.12.29 23:59:59   recovery_factor = 0.0
CQ      0       23:58:34.935    Core 1  2020.12.29 23:59:59   sharpe_ratio = 0.0
CF      0       23:58:34.935    Core 1  2020.12.29 23:59:59   margin_level = -nan
MO      0       23:58:34.935    Core 1  2020.12.29 23:59:59   custom_fitness = 1.778636325028488 e-322
RI      0       23:58:34.935    Core 1  2020.12.29 23:59:59   deals = -1533096544
GO      0       23:58:34.935    Core 1  2020.12.29 23:59:59   trades = 32759
HF      0       23:58:34.935    Core 1  2020.12.29 23:59:59   profittrades = 16383
HO      0       23:58:34.935    Core 1  2020.12.29 23:59:59   losstrades = 0
MJ      0       23:58:34.935    Core 1  2020.12.29 23:59:59   shorttrades = -1
CM      0       23:58:34.935    Core 1  2020.12.29 23:59:59   longtrades = -1
KE      0       23:58:34.935    Core 1  2020.12.29 23:59:59   winshorttrades = -1
KQ      0       23:58:34.935    Core 1  2020.12.29 23:59:59   winlongtrades = -1
QH      0       23:58:34.935    Core 1  2020.12.29 23:59:59   conprofitmax_trades = -1534783007
PF      0       23:58:34.935    Core 1  2020.12.29 23:59:59   maxconprofit_trades = 32759
ML      0       23:58:34.935    Core 1  2020.12.29 23:59:59   conlossmax_trades = 0
IE      0       23:58:34.935    Core 1  2020.12.29 23:59:59   maxconloss_trades = 0
HQ      0       23:58:34.935    Core 1  2020.12.29 23:59:59   avgconwinners = 0
CI      0       23:58:34.935    Core 1  2020.12.29 23:59:59   avgconloosers = 0
QQ      0       23:58:34.935    Core 1  2020.12.29 23:59:59   ghpr = 6.951582202014298 e-310
HD      0       23:58:34.935    Core 1  2020.12.29 23:59:59   ghprpercent = 8.082419900316952 e-320
LE      0       23:58:34.935    Core 1  2020.12.29 23:59:59   ahpr = 6.951582466171288 e-310
GP      0       23:58:34.935    Core 1  2020.12.29 23:59:59   ahprpercent = 2.470328229206233 e-323
II      0       23:58:34.935    Core 1  2020.12.29 23:59:59   zscore = 6.951582382832739 e-310
QS      0       23:58:34.935    Core 1  2020.12.29 23:59:59   zscorepercent = 0.0
PD      0       23:58:34.935    Core 1  2020.12.29 23:59:59   lrcorr = 0.0
CR      0       23:58:34.935    Core 1  2020.12.29 23:59:59   lrstderror = 3.162020133383978 e-322
GM      0       23:58:34.935    Core 1  2020.12.29 23:59:59   symbols = 391475719
RG      0       23:58:34.935    Core 1  2020.12.29 23:59:59   corr_prf_mfe = 2.659058588536774 e-312
FP      0       23:58:34.935    Core 1  2020.12.29 23:59:59   corr_prf_mae = 6.951582431904475 e-310
LJ      0       23:58:34.935    Core 1  2020.12.29 23:59:59   corr_mfe_mae = 1.934147039389014 e-315
RJ      0       23:58:34.935    Core 1  2020.12.29 23:59:59   mfe_a = 6.951582173927753 e-310
KS      0       23:58:34.935    Core 1  2020.12.29 23:59:59   mfe_b = 0.0
ID      0       23:58:34.935    Core 1  2020.12.29 23:59:59   mae_a = 8.538950297007383 e-300
LR      0       23:58:34.935    Core 1  2020.12.29 23:59:59   mae_b = 0.0
ND      0       23:58:34.935    Core 1  2020.12.29 23:59:59   holding_time_min = 00:00:00
PN      0       23:58:34.935    Core 1  2020.12.29 23:59:59   holding_time_max = 00:00:00
GQ      0       23:58:34.935    Core 1  2020.12.29 23:59:59   holding_time_avr = 00:00:00

opzione 2

2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   bars = -1
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   ticks = 0
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   symbol = 䆇樇翷
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   initial_deposit = 6.951844503800728 e-310
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   withdrawal = 3.458459520888726 e-323
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   profit = -nan
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   grossprofit = 9.568778329205075 e-310
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   grossloss = 0.0
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   maxprofit = 0.0
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   minprofit = 3.864959344282877 e-312
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   conprofitmax = 3.862032339566677 e-312
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   maxconprofit = 1.075317587769853 e-311
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   conlossmax = 9.05495701890495 e-310
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   maxconloss = 0.0
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   balance_min = 0.0
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   maxdrawdown = -nan
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   drawdownpercent = 1.778636325028488 e-322
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   reldrawdown = 6.951533981725193 e-310
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   reldrawdownpercent = 1.335089302104764 e-307
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   equity_min = -nan
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   maxdrawdown_e = -nan
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   drawdownpercent_e = 6.951533898402849 e-310
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   reldrawdown_e = 1.073729870228428 e-311
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   reldrawdownpercnt_e = 0.0
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   expected_payoff = 0.0
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   profit_factor = 3.864959344915281 e-312
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   recovery_factor = 9.881312916824931 e-324
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   sharpe_ratio = 3.864959351792675 e-312
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   margin_level = 9.054957018885978 e-310
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   custom_fitness = 3.864959359539624 e-312
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   deals = 1780533352
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   trades = 32759
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   profittrades = 1772945315
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   losstrades = 32759
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   shorttrades = 1780534738
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   longtrades = 32759
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   winshorttrades = 1775188141
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   winlongtrades = 32759
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   conprofitmax_trades = 16359
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   maxconprofit_trades = 0
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   conlossmax_trades = 1780534738
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   maxconloss_trades = 32759
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   avgconwinners = 5
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   avgconloosers = 0
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   ghpr = 4.940656458412465 e-324
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   ghprpercent = 3.864959353571311 e-312
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   ahpr = 9.881312916824931 e-324
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   ahprpercent = 6.951446327825149 e-310
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   zscore = 3.864959353373685 e-312
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   zscorepercent = 0.0
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   lrcorr = 3.864959358946745 e-312
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   lrstderror = 2.816174181295105 e-322
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   symbols = 592434208
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   corr_prf_mfe = 6.951533946411159 e-310
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   corr_prf_mae = 0.0
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   corr_mfe_mae = 6.951533898778685 e-310
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   mfe_a = 3.864959353373685 e-312
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   mfe_b = 6.951533898682886 e-310
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   mae_a = 3.864959352978432 e-312
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   mae_b = 6.951533900420317 e-310
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   holding_time_min = 721296048 d 
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   holding_time_max = 1758699664 d 
2021.01.01 02:30:57.588 Core 1 2020.12.30 23:59:59   holding_time_avr = -22966109 d 

 
Aleksei Skrypnev:

2 problema.

Forum sul trading, sui sistemi di trading automatizzati e sulla verifica delle strategie di trading.

Errori, bug, domande

Renat Fatkhullin, 2021.01.01 00:14

Se avete delle prove, dovreste fornirle in una forma completamente coerente e tecnicamente riproducibile.
 
fxsaber:

Forse presumo che non funzioni a causa di un errato trasferimento del codice dallo script all'Expert Advisor.

Le invio un esempio.

Procedura.

1. Si prende un qualsiasi Expert Advisor - ho testato più volte il Movin' Averag standard.

2. Inserisco le inclusioni nella parte superiore:

 #include <fxsaber\SingleTesterCache\SingleTesterCache.mqh>
 #include <fxsaber\SingleTesterCache\ExpTradeSummarySingle.mqh> 
  #include <fxsaber\MultiTester\MTTester.mqh> 

3. In OnDeinit inserisco questo dal secondo script da qui: https://www.mql5.com/it/code/27611:

  uchar Bytes2[];
  
  if (MTTESTER::GetLastTstCache(Bytes2) != -1) // Se fosse possibile leggere l'ultimo record della cache di una singola esecuzione
  {
    const SINGLETESTERCACHE SingleTesterCache(Bytes2); // Inserirlo nell'oggetto appropriato.

    SingleTesterCache.SaveSet(NULL, true, "Created by " + __FILE__); // Salvare il file impostato con i dettagli.
    
    double Balance[];
    double Equity[];
  
      
    Print(SingleTesterCache.Header.ToString());  // Emette l'intestazione di un singolo passaggio.
    Print(SingleTesterCache.Summary.ToString()); // Statistica.
    Print(SingleTesterCache.Inputs);             // Parametri di ingresso.

3.2 Ho provato la stessa "sorta di" in questa forma

 const SINGLETESTERCACHE SingleTesterCache; // Загоняем ее в соответствующий объект.
            
            double Balance[];
    double Equity[];
            
               Print(SingleTesterCache.Header.ToString());  // Вывели заголовок одиночного прохода.
  Print(SingleTesterCache.Summary.ToString()); // Статистику.
      Print(SingleTesterCache.Summary.ToString()); // Статистику.
    Print(SingleTesterCache.Inputs);             // Входные параметры. 
 
Aleksei Skrypnev:

Forse presumo che non funzioni a causa di un errato trasferimento del codice dallo script all'Expert Advisor.

Ora invierò un esempio.

Sarebbe meglio se ci fossero dei file pronti. Non capisco cosa si debba ottenere.

 
fxsaber:

Preferisco avere i file pronti per l'uso. E non capisco cosa devi ottenere.

Sì, volevo ottenere le statistiche dell'ultimo singolo run e scriverle su un file, per esempio, come hai scritto qui nel topic del multitester. https://www.mql5.com/ru/forum/318305/page23#comment_19934192.

Per fare a meno di inserire codice in OnDeinit EA ovunque.

In realtà, non sono necessarie tutte le statistiche, ma solo alcuni parametri. Ad esempio, MQLInfoString(MQL_PROGRAM_NAME),TesterStatistics(STAT_SHARPE_RATIO).

Библиотеки: MultiTester
Библиотеки: MultiTester
  • 2020.11.26
  • www.mql5.com
Статьи и техническая библиотека по автоматическому трейдингу: Библиотеки: MultiTester
 
Aleksei Skrypnev:

Sì, volevo estrarre le statistiche dell'ultima corsa singola e scriverle in un file, ad esempio, come hai scritto qui nell'argomento multitester. https://www.mql5.com/ru/forum/318305/page23#comment_19934192

Per evitare di inserire codice in OnDeinit EA ovunque.

In realtà, non sono necessarie tutte le statistiche, ma solo alcuni parametri. Ad esempio, MQLInfoString(MQL_PROGRAM_NAME),TesterStatistics(STAT_SHARPE_RATIO).

Probabilmente si può provare a eseguire degli esempi dalla consegna o dalle discussioni.

 
fxsaber:

Si potrebbe provare a eseguire gli esempi della consegna o delle discussioni.

Non ho ancora trovato questa funzionalità o qualcosa di simile per registrare le statistiche di passaggio in un file csv. Anche nelle librerie non ho trovato le funzioni adatte. Ne cercherò altre.

Ho visto un blocco di questo tipo, ma non ho capito come richiamare le informazioni necessarie da esso

stringa ToString( void ) const

{

return(this.Header.expert_path[] + "\n; " +

this.Header.symbol[] + "\n; " +

::TimeToString(this.Header.date_from, TIME_DATE) + " - " + ::TimeToString(this.Header.date_to, TIME_DATE) + "\n; " +

::DoubleToString(this.Summary.TesterStatistics(STAT_PROFIT), 0) + ", " + " +

::DoubleToString(this.Summary.TesterStatistics(STAT_TRADES), 0) + ", " + ::DoubleToString(this.Summary.TesterStatistics(STAT_TRADES), 0) + ", " +

::DoubleToString(this.Summary.TesterStatistics(STAT_PROFIT_FACTOR), 2) + ", " + ::DoubleToString(this.Summary.TesterStatistics(STAT_PROFIT_FACTOR), 2) + ", " +

::DoubleToString(this.Summary.TesterStatistics(STAT_EXPECTED_PAYOFF), 2) + ", -" + ::DoubleToString(this.Summary.TesterStatistics(STAT_EXPECTED_PAYOFF), 2) + ", -" +

::DoubleToString(this.Summary.TesterStatistics(STAT_EQUITY_DD)), 2));

}

 
Aleksei Skrypnev:

Vedo un blocco di questo tipo, ma non capisco come richiamare le informazioni richieste da esso

Ogni volta che guardo il mio codice come se fosse di qualcun altro, non lo ricordo affatto.

Ecco perché non posso darvi un suggerimento.

 
fxsaber:

Ogni volta che guardo il mio codice come se fosse di qualcun altro, stupidamente non lo ricordo affatto.

Ecco perché non posso dirvelo.

Capisco, quindi più si studia e più si capisce. È solo che, a quanto ho capito, non tutte le funzionalità potrebbero non essere incluse nella versione attuale della libreria, cioè potrebbe mancare qualcosa per svolgere il compito. L'importante è capire se è possibile o meno).

 
Aleksei Skrypnev:

L'importante è capire se è possibile o meno).

https://www.mql5.com/it/code/viewcode/27611/229701/exptradesummarysingle.mqh