MetaTrader 5 Strategy Tester: bugs, bugs, suggestions for improvement - page 9

 
Vladimir Karputov:

Take the standard EA from the delivery and check - everything works. But if input parameters are declared as sinput - then these parameters cannot be optimised.

I have chosen from standard EAs:

MACD Sample

But everything remains the same:

MACD Sample Input

I made only magic parameter in my sinput because there is no sense in its optimization.

input and sinput

My build is 2155. May be there is something wrong with the build?

 
Mihail Matkovskij:

I chose from the standard experts:

But everything remains the same:

In my own sinput, I only made the magic parameter, as there is no point in optimising it.


My build is 2155. May be there is something wrong with the build?

There, I've got it. I need to put flags next to the optimized parameters, while earlier it was not necessary to set optimization parameters.

 
Mihail Matkovskij:

I chose from the standard experts:

But everything remains the same:

In my own sinput, I only made the magic parameter, as it makes no sense to optimise it.


My build is 2155. May be there is something wrong with the build?

The build is alright, while you are not paying attention. You have taken a standard EA and I see that its parameters have ACCEPTABLE FOR CHANGE. All you need to do is check the boxes in the "Variable" column.


Added: as I was writing my reply, I see you have figured it out.

 
Vladimir Karputov:

The build is fine, but you are inattentive. You have taken the standard EA and I can see that its parameters are ACCEPTABLE to change. All you need to do is check the boxes in the "Variable" column.


Added: while I was writing a reply, I see you figured it out.

Yes. But thanks anyway!

 
When the Tester is counting (red Stop button), the mouse wheel in the Options tab does not work (you need to scroll through a lot of parameters).
 
Hello! A question about optimisation. I have 4 agents in my terminal. In the past, the whole system could freeze due to optimization. Therefore, I used to disable one agent and everything worked fine. In new terminal version I noticed that first agent is not loaded at all. So, I switched on the fourth agent. Did I do the right thing, should I expect a freeze with 4 agents running, or is the first agent still unloaded during the whole optimization, as I assumed?
 
Mihail Matkovskij:
Hi! Question about optimization. I have 4 agents in my terminal. Previously, due to optimization, there could be freezes of the whole system. Therefore, I used to disable one agent and everything worked fine. In new terminal version I noticed that first agent is not loaded at all. So, I switched on the fourth agent. Was I right, should I expect a freeze with 4 agents running, or is the first agent still unloaded during the whole optimization, as I assumed?

Do you happen to have a Visual Tester window open on the first agent? If yes, close the Visual Tester window and agent #1 will become free.

 

The tester does not reset the last few ticks of the test interval.

EA

#define  TOSTR(A) " " + #A + " = " + (string)Tick.A
#define  TOSTR2(A) " " + #A + " = " + ::DoubleToString(Tick.A, _Digits)

string TickToString( const MqlTick &Tick, const bool Flags = true )
{
  return(TOSTR(time) + "." + ::IntegerToString(Tick.time_msc % 1000, 3, '0') + TOSTR2(bid) + TOSTR2(ask));
}

void OnDeinit( const int )
{
  MqlTick Tick;

  if (SymbolInfoTick(_Symbol, Tick))
    Print(TickToString(Tick)); // Распечатываем последний тик интервала тестирования.
}


Result

EURGBP.rann_RannForex: history data begins from 2018.02.06 00:00
EURGBP.rann_RannForex: ticks data begins from 2018.02.06 00:00
agent process started on 127.0.0.1:3000
connecting to 127.0.0.1:3000
connected
authorized (agent build 2162)
EURGBP.rann_RannForex,M1 (MetaQuotes-Demo): testing of Experts\Test5-4.ex5 from 2019.09.28 00:00 to 2019.10.01 00:00
common synchronization completed
EURGBP.rann_RannForex: ticks synchronized already [73 bytes]
MetaTester 5 started on 127.0.0.1:3000
initialization finished
login (build 2162)
4372 bytes of account info loaded
1482 bytes of tester parameters loaded
188 bytes of input parameters loaded
2813 bytes of symbols list loaded
expert file added: Experts\Test5-4.ex5. 13105 bytes loaded
7703 Mb available, 96 blocks set for ticks generating
calculate profit in pips, initial deposit 10000, leverage 1:100
successfully initialized
14 Kb of total initialization data received
Intel Core i7-2700 K  @ 3.50 GHz, 16301 MB
EURGBP.rann_RannForex: symbol to be synchronized
EURGBP.rann_RannForex: symbol synchronized, 3720 bytes of symbol info received
EURGBP.rann_RannForex: load 57 bytes of history data to synchronize in 0:00:00.001
EURGBP.rann_RannForex: history synchronized from 2018.02.06 to 2019.10.01
EURGBP.rann_RannForex: ticks synchronization started
EURGBP.rann_RannForex: load 64 bytes of tick data to synchronize in 0:00:00.000
EURGBP.rann_RannForex: history ticks synchronized from 2019.09.30 to 2019.10.01
EURGBP.rann_RannForex,M1: history cache allocated for 611815 bars and contains 608725 bars from 2018.02.06 02:00 to 2019.09.27 23:54
EURGBP.rann_RannForex,M1: history begins from 2018.02.06 02:00
EURGBP.rann_RannForex,M1 (MetaQuotes-Demo): generating based on real ticks
EURGBP.rann_RannForex,M1: testing of Experts\Test5-4.ex5 from 2019.09.28 00:00 to 2019.10.01 00:00 started
EURGBP.rann_RannForex : real ticks begin from 2019.09.30 00:00:00
final balance 10000.00 pips
2019.09.30 23:59:58    time = 2019.09.30 23:59:58.022 bid = 0.88612 ask = 0.88741
EURGBP.rann_RannForex,M1: 101751 ticks, 1424 bars generated. Test passed in 0:00:00.558 (including ticks preprocessing 0:00:00.031).
269 Mb memory used including 35 Mb of history data, 64 Mb of tick data
log file "C:\Program Files\ICMarkets - MetaTrader 5\Tester\Agent-127.0.0.1-3000\logs\20191002.log" written
connection closed


What should actually be at the end.


The bug is reproduced on any interval.

 

There are new options for grouping parameters via input groups:

//+------------------------------------------------------------------+
//|                                                      ProjectName |
//|                                      Copyright 2018, CompanyName |
//|                                       http://www.companyname.net |
//+------------------------------------------------------------------+
input group           "Strategy #1"
input ENUM_TIMEFRAMES InpS1_TF    =PERIOD_M30;        // timeframe
input string          InpS1_Sym1  ="EURUSD";          // first leg
input string          InpS1_Sym2  ="GBPUSD";          // second leg
input int             InpS1_Period=20;                // period of sigma calculation
input double          InpS1_Sigma =3.0;               // sigma level for trade
input int             InpS1_Bars  =100;               // bars for correlation
input double          InpS1_Level =0.7;               // correlation level for trade
input double          InpS1_Lot   =0.1;               // trade lot
sinput long           InpS1_Magic =100;               // Magic Number

input group           "Strategy #2"
input ENUM_TIMEFRAMES InpS2_TF    =PERIOD_M30;        // timeframe
input string          InpS2_Sym1  ="EURJPY";          // first leg
input string          InpS2_Sym2  ="GBPJPY";          // second leg
input int             InpS2_Period=20;                // period of sigma calculation
input double          InpS2_Sigma =3.0;               // sigma level for trade
input int             InpS2_Bars  =100;               // bars for correlation
input double          InpS2_Level =0.7;               // correlation level for trade
input double          InpS2_Lot   =0.1;               // trade lot
sinput long           InpS2_Magic =200;               // Magic Number

input group           "Strategy #3"
input ENUM_TIMEFRAMES InpS3_TF    =PERIOD_M30;        // timeframe
input string          InpS3_Sym1  ="EURCHF";          // first leg
input string          InpS3_Sym2  ="GBPCHF";          // second leg
input int             InpS3_Period=20;                // period of sigma calculation
input double          InpS3_Sigma =3.0;               // sigma level for trade
input int             InpS3_Bars  =100;               // bars for correlation
input double          InpS3_Level =0.7;               // correlation level for trade
input double          InpS3_Lot   =0.1;               // trade lot
sinput long           InpS3_Magic =300;               // Magic Number

input group           "Strategy #4"
input ENUM_TIMEFRAMES InpS4_TF    =PERIOD_M30;        // timeframe
input string          InpS4_Sym1  ="EURUSD";          // first leg
input string          InpS4_Sym2  ="AUDUSD";          // second leg
input int             InpS4_Period=20;                // period of sigma calculation
input double          InpS4_Sigma =3.0;               // sigma level for trade
input int             InpS4_Bars  =100;               // bars for correlation
input double          InpS4_Level =0.7;               // correlation level for trade
input double          InpS4_Lot   =0.1;               // trade lot
sinput long           InpS4_Magic =400;               // Magic Number

input group           "Strategy #5"
input ENUM_TIMEFRAMES InpS5_TF    =PERIOD_M30;        // timeframe
input string          InpS5_Sym1  ="USDCAD";          // first leg
input string          InpS5_Sym2  ="USDCHF";          // second leg
input int             InpS5_Period=20;                // period of sigma calculation
input double          InpS5_Sigma =3.0;               // sigma level for trade
input int             InpS5_Bars  =100;               // bars for correlation
input double          InpS5_Level =0.7;               // correlation level for trade
input double          InpS5_Lot   =0.1;               // trade lot
sinput long           InpS5_Magic =500;               // Magic Number

input group           "Strategy #6"
input ENUM_TIMEFRAMES InpS6_TF    =PERIOD_M30;        // timeframe
input string          InpS6_Sym1  ="USDCHF";          // first leg
input string          InpS6_Sym2  ="USDJPY";          // second leg
input int             InpS6_Period=20;                // period of sigma calculation
input double          InpS6_Sigma =3.0;               // sigma level for trade
input int             InpS6_Bars  =100;               // bars for correlation
input double          InpS6_Level =0.7;               // correlation level for trade
input double          InpS6_Lot   =0.1;               // trade lot
sinput long           InpS6_Magic =600;               // Magic Number

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   return(INIT_SUCCEEDED);
  }

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnTick()
  {

  }  
//+------------------------------------------------------------------+


Groups are easier to work with and can be collapsed.

 
MetaQuotes Software Corp.:

There are new options for grouping parameters via input group:

Groups are more convenient to work with and can be collapsed.

Thank you. I would also like to make "Collapse/Uncollapse all groups".

Reason: