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

 

In the tester, limit orders are not checked for acceptance on the set/modify tick.

Because of this, when a limit order is placed at the current price, it is not executed, which is not in line with the market rules.


Will there be any changes in the tester for this situation?

 

The tester has been running in 12 streams for 27 hours now. This is an odd memory picture. You can see here that the application doesn't eat up much memory.


Especially the status of the agents is more than free.



There is also one instance which has already finished working in 1 thread. Swap memory is allocated.


Closed down the running instance:

Immediately 26 GB freed up. I think the threads are holding memory in the allocated state? Process Explorer shows just that. Each instance is holding 4GB (except one). That said, one has dropped out (should be 12).


The problem is that even though private memory is not being used, when the swap file is full, the same Chrome starts swearing about insufficient memory. At the same time, the RAM is half free...


The second question is this. Why during genetic optimization do threads stand idle and wait for one thread to finish? Does it make sense to kill them by computing with prediction and detecting different results of waiting for the expected thread to finish? Or try to "shake out" some parameters again and look for other solutions?

PS. Put agents in disabled and then activated again - they stopped eating memory. But it seems to me that the disk cache will also re-create on startup?
 

Bug in the cancellation time of a pending order on a money shortage event.

There is zero time (highlighted in the screenshot) instead of cancellation time.

And the status placed instead of canceled.

 

Now to analyse the situation on the highlighted chunk


you have to move the cursor, remember the pop-up date, open the run chart, go to the required place in the Trade History and double-click on the relevant line in the table.


Can this all be replaced by double-clicking on the spot in the chart above?

 
fxsaber:

Can this all be replaced by double clicking on the spot on the graph above?

I think that's fantastic, a much needed "feature" - I support it !!!

 

Forum on trading, automated trading systems and trading strategy testing

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

fxsaber, 2019.10.14 23:32

In MT5 you can close a position and get a loss (the balance before opening is less than the balance after closing). But at the same time MT5 Tester (Terminal not checked) will consider this trade as profitable.

I drew up an Expert Advisor for playing

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

#define  Ask SymbolInfoDouble(_Symbol, SYMBOL_ASK)

void OnTick()
{
  if (!OrderSelect(0, SELECT_BY_POS))
    OrderSend(_Symbol, OP_BUY, 1, Ask, 0, 0, 0);
  else if ((OrderProfit() > -OrderCommission()) &&
           (OrderProfit() < -OrderCommission() * 2) &&
           OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 0))
    ExpertRemove();
}


Run it in the Strategy Tester from a trading server, where there is a commission (I ran it on this one: ForexTimeFXTM-Demo01).

The result is in pictures.


In the screenshot you can see that there was one BUY position, which closed with total loss - the initial balance has decreased.


And that is what is highlighted here in the left column - the Expert Advisor has suffered a loss.

And now we have a look at what is highlighted in the second column. Everything is great there with positive mathematical expectation and 100% profitable trades!


So it turns out that the Expert Advisor is losing while the indicator looks like a profitable one. Hence the PF calculation is skewed.


ZZY wrote an example in a minute. I`ve been thinking with terror, how long it should take to write it in MQL5 or SB. Who is not lazy - try it.

 

In the Tester, the Overview tab has a very handy list of previous actions with an interactive filter.

In this list, the names of EAs are displayed without path. Because of this, when there are two EAs with the same name, but in different folders, the list does not show (and cannot filter) which EA corresponds to which entry.


Is it possible to output in this list of previous actions the names of EAs with their paths from the folder Experts?

I don't use indicators, but probably it would be reasonable to do the same for them.

 
The tester takes into account both sides of CloseBy trades when calculating the number of trades. Hence incorrect number of trades, mathematical expectation, etc.
 
EA
#include <MT4Orders.mqh> // https://www.mql5.com/ru/code/16006

#define  Bid SymbolInfoDouble(_Symbol, SYMBOL_BID)
#define  Ask SymbolInfoDouble(_Symbol, SYMBOL_ASK)

int OnInit()
{
  return(OrderCloseBy(OrderSend(_Symbol, OP_BUY, 1, Ask, 0, 0, 0), OrderSend(_Symbol, OP_SELL, 
2, Bid, 0, 0, 0)));
}


the report is calling up nothing but zeros. Although the trade was in progress.


Why = 1 is also not clear. It is not present in source code.

 
fxsaber:
EA


the report is calling up nothing but zeros. Although the trade was in progress.


Why OnTester == 1 is also not clear. It is not present in the source code.

Are you sure it's trading in OnInit? And how are you going to use GetLastError with your code? And another question. Are you sure about the order in which the function arguments are calculated?
Reason: