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

 
Alexey Viktorov:

So you didn't manage to register an account on the beta?

No.
 

The MT4-Tester had such an assistant for GAs.


It helped considerably to reduce the time of Optimisation. For example, if the balance is at the floor, why go further? MT5 doesn't have that. That's why we have to build such reasonable things into our EAs. I don't think many authors do that. So it would probably be reasonable to transfer such functionality to MT5-Tester as well.


Also the assistants for GA are relevant. Here is the simplest one.

Forum on trading, automated trading systems and trading strategies testing

Expert Advisors: Validate

fxsaber, 2020.01.29 15:55

I recommend to use in my EAs a similar GA helper.

sinput int inMinTrades = 500; // Минимальное количество трейдов (позиций).
sinput int inMaxTrades = 90000; // Максимальное количество трейдов (позиций).

double OnTester()
{
  return(((TesterStatistics(STAT_TRADES) >= inMinTrades) && (TesterStatistics(STAT_TRADES) <= inMaxTrades)) ? TesterStatistics(STAT_PROFIT) : 0);
}

It does not allow GA to go to the side of weak statistical results. It increases the quality and speed of results. And for Validate it also filters from passages with weak statistical values.


For example, when readjusting based on three months' calculations, I set the minimum number of trades > 100. Otherwise there is higher probability of encountering a pass in GA that gives the largest profit due to small number of successful (random) trades. Clearly, such a pass should have nothing to do with choosing it for further trading.

I think it is reasonable for the tester to have such helpers. All the more so, as it does not require any computational cost.

 

Hello all.

I have a multi-market robot. It trades statistical arbitrage, spreads. The robot is designed so that it takes instruments from market overview itself or takes them from spreads file (which is located in root directory of program in files folder). The robot analyses the data, selects the most promising pairs of instruments, and trades them.

Question, will the mt5 strategy tester be able to test it? If the trading instruments are not listed in the robot's input parameters, as it usually is, but the instruments are taken from the market overview or from the Files folder, is the tester intended to function?

 
Peresvet Timonkin:

Hello all.

I have a multi-market robot. It trades statistical arbitrage, spreads. The robot is designed so that it takes instruments from market overview itself or takes them from spreads file (which is located in root directory of program in files folder). The robot analyses the data, selects the most promising pairs of instruments, and trades them.

Question, will the mt5 strategy tester be able to test it? If the trading instruments are not listed in the robot's input parameters, as it usually is, but the instruments are taken from the market overview or from the Files folder, is the tester intended to function?

The market overview is generated by the calls from the code to the symbols. For a tester, there is bound to be a currency list in any variant. And in the real world there is no problem.

What is on the screenshot is for optimisation.
 
Alexey Viktorov:

Market review is formed by symbol calls from the code. For a tester there must be a list of currencies in any variant. And in the real world there is no problem.

What is on the screenshot is for optimisation.

Do I understand correctly that you cannot test with this kind of setup as I do?

the tester cannot take data from the market review from the history?

And as for the file in which trading tools are prescribed, the tester can't work with it either?

i just read the manual, but i didn't find anything about it, it says that i can test and optimize multi strategies, but i don't know much about it.

 
Peresvet Timonkin:

Do I understand correctly that you cannot test with this kind of setup as I do?

the tester cannot take data from the market review from the history?

And as for the file in which trading tools are prescribed, the tester can't work with it either?

i just read the whole manual for the tester, i couldn't find a word about it, it says that i can test and optimize multirate strategies, but i don't know much about it.

If you try hard, you can do anything. For example, in OnInit() request ticks of the required currencies and thereby add them to the market overview and then work with the market overview. But in this case, no matter how you look at it, there should be a list of currencies. We can have two options: work with the list and work with those in the market report. Accordingly, we have to set a condition in OnInit() if work in the tester, then work only with the list. There is such an Expert Advisor in the Market.

As for the file: It is of course possible, but we have to consider the location of the file. It must be located in the tester folder or in the folder shared by all terminals. Or insert it as a resource.
 

Forum on trading, automated trading systems and trading strategy testing

MetaTrader 5 Strategy Tester: bugs, bugs, suggestions for improvement

fxsaber, 2020.01.22 23:08

My build 2300. In Pips mode I have started to take volume into account, Thank you!


However, profit of InOut trades in this mode is calculated incorrectly.


If we run in normal mode, the profit is correct.



Therefore, the pips mode is not working now on Netting (it shows overstated profit).


2310 is relevant. It is impossible to use the pips mode on Netting.

 

In 2310 I noticed that my EA, which makes frequent modifications, cannot be profiled.

Sketched out a test one.

input int inFakeRange = 0;
sinput int inOffset = 10000;

#include <MT4Orders.mqh> // https://www.mql5.com/ru/code/16006

#define  Ask SymbolInfoDouble(_Symbol, SYMBOL_ASK)

void OnTick()
{
  static long Ticket = -1;
  
  if (Ticket == -1)
    Ticket = OrderSend(_Symbol, OP_BUYLIMIT, 1, Ask - inOffset * _Point, 0, 0, 0);
  else
    OrderModify(Ticket, Ask - inOffset * _Point, 0, 0, 0);
}

It reproduces the impossibility of profiling literally immediately in real tick mode, as everything is very slow.


However, it also causes the terminal to HOLD when running on real ticks (even in pips mode) a single pass! Just some kind of killer.


If you do its Optimisation (on the first parameter), it goes off without a hitch, but it brings up some bad thoughts about performance...


HH If you run it in the Visualizer and close it before it's finished, the Terminal hangs.

 
fxsaber:

If you optimise it (for the first parameter), it's fine, but you get some bad thoughts about performance...

I can only compare it with the Virtual variant.

input int inFakeRange = 0;
sinput int inOffset = 10000;

#include <MT4Orders.mqh> // https://www.mql5.com/ru/code/16006

#define  VIRTUAL_TESTER // Запуск в виртуальном торговом окружении
#include <fxsaber\Virtual\Virtual.mqh> // https://www.mql5.com/ru/code/22577

#define  Ask SymbolInfoDouble(_Symbol, SYMBOL_ASK)

void OnTick()
{
  static long Ticket = -1;
  
  if (Ticket == -1)
    Ticket = OrderSend(_Symbol, OP_BUYLIMIT, 1, Ask - inOffset * _Point, 0, 0, 0);
  else
    OrderModify(Ticket, Ask - inOffset * _Point, 0, 0, 0);
}


Normal variant.

optimization finished, total passes 5
optimization done in 1 minutes 04 seconds
shortest pass 0:00:12.560, longest pass 0:00:13.608, average pass 0:00:12.808
local 5 tasks (100%), remote 0 tasks (0%), cloud 0 tasks (0%)


With Virtual.

optimization finished, total passes 5
optimization done in 0 minutes 06 seconds
shortest pass 0:00:00.954, longest pass 0:00:02.060, average pass 0:00:01.231
local 5 tasks (100%), remote 0 tasks (0%), cloud 0 tasks (0%)


Tester is 13 times slower on the elementary EA in Pips mode where there are not even any checks! Build 2310.

 
fxsaber:

The tester is 13 times slower on an elementary EA in pips mode, where there aren't even any checks! Build 2310.

Even this EA is more than twice slower than Virtual in Pips mode.

input int inFakeRange = 0;
sinput int inOffset = 10000;

#include <MT4Orders.mqh> // https://www.mql5.com/ru/code/16006

#define  Ask SymbolInfoDouble(_Symbol, SYMBOL_ASK)

void OnTick()
{
  static long Ticket = -1;
  
  if (Ticket == -1)
    Ticket = OrderSend(_Symbol, OP_BUYLIMIT, 1, Ask - inOffset * _Point, 0, 0, 0);
}

Why does this happen? The entire Expert Advisor is setting BuyLimit on the first tick. There is nothing else!