MT4-Tester VS MT5-Tester - page 3

 
fxsaber:
Proof

This is not proof.

You are mistaken.

My assertion stands - the said expert is only testing access to transaction history.
 
Renat Fatkhullin:

This is not proof.

You are mistaken.

What is your mistake? I even checked myself putting BreakPoints wherever there is a history function and running CTRL+F5 for debugging. All worked out cleanly.
Renat Fatkhullin:
My assertion stands - the said expert is testing only access to the history of transactions.

You have jumped to conclusions.

 

I'm not sure that such comparisons make any sense - cloud computing negates all the speed advantages of the MT4 tester.

And, besides, in this case, indeed, the EA is testing purely data access speed. But I don't think this is a bottle neck for most EAs.

After the introduction of accounts with hedging positions in MT5 - I personally do not see any pluses of MT4 for me at all. I use cross-platform libraries only because I have MT4 on my real accounts.

The only thing that I personally miss - pointers or array references. I don't need to copy data in indicators for some reason. MQL5 has everything else.

Распределенные вычисления в сети MQL5 Cloud Network
Распределенные вычисления в сети MQL5 Cloud Network
  • cloud.mql5.com
Заработать деньги, продавая мощности своего компьютера для сети распределенных вычислений MQL5 Cloud Network
 
fxsaber:
You jumped to conclusions.
What else is there? Querying data, and dumping it into a file. There are no other actions - what do you think this EA is testing?
 
fxsaber:

ZS Not all runs matched perfectly. So one of the three is definitely lying (MT4+TDS, MT5, MT4Orders). We will have to look for it.

Thanks to the sub, the culprit has been found, it always happens when there is a possibility to compare.

Expert Advisor showing the bug

// MQL4&5-code

#property strict

#ifdef __MQL5__
  #define Bid (SymbolInfoDouble(_Symbol, SYMBOL_BID))
  #define Ask (SymbolInfoDouble(_Symbol, SYMBOL_ASK))
#endif // __MQL5__

#define  PRINT(A) Print(#A + " = " + (string)(A));

void OnTick()
{
  static bool FirstRun = true;
  
  static const double PrevBid = Bid;
  static const double PrevAsk = Ask;
  
  if (FirstRun)
  {
    PRINT((PrevBid != Bid) || (PrevAsk != Ask))
    
    FirstRun = false;
  }
}


MT4

2017.05.08 10:57:33.056 2017.04.10 00:00:08  TDS_Test EURUSD,M1: (PrevBid!=Bid)||(PrevAsk!=Ask) = false


MT5

2017.05.08 11:01:31.266 2017.04.10 00:00:08   (PrevBid!=Bid)||(PrevAsk!=Ask) = true
 
George Merts:
What else is there? The data request and saving it to a file. There are no other operations - what exactly is this EA testing?
I suggest that you read the entire discussion, then such questions will not even arise.
George Merts:

After the introduction of accounts with hedging positions in MT5, I personally do not see a single advantage of MT4.

This thread stands out somewhat for its concentration of constructive content. So personal preferences are better discussed here, for example.

 
fxsaber:
Where is the error? I even checked myself, put BreakPoints everywhere where there's History-functions, and ran debugging by CTRL+F5. It all worked out cleanly.

You jumped to conclusions.

All in all:

  1. work with history is in full swing, trades are closed after history scanning
  2. use MT4Orders.mqh - this is an end to the purity of the experiment. monstrous library with an overhead, written disgustingly and unreadable. someone has severely demonstrated their laziness
  3. writing for(i=200 000; i>=0; i--) OrderSelect on every tick is nothing but madness and an attempt to repeat the joke about Japanese saw and Russian men exclusively
       for(int i=OrdersTotal()-1; i>=0; i--)
          if(OrderSelect(i,SELECT_BY_POS) && ((!TradeTime) || (OrderProfit()>0) || 
             ((OrderType() == OP_BUY)  && (PriceToInteger(OrderOpenPrice()) - IntBid >= Limit)) ||
             ((OrderType() == OP_SELL) && (IntAsk - PriceToInteger(OrderOpenPrice()) >= Limit))))
             OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),0);
    
  4. the whole test was written solely for the sake of the cycle from point 3

    Roughly we take 1 800 000 ticks in the test, where 200 000 deals are opened in 5 days. Let's simplify it to 900 000 ticks, where 100 000 orders are scanned in history and we get 900 000 000 * 100 000 = 900 000 000 000 000 OrderSelect calls (with overflow from the library). It is exactly 900 billion OrderSelect calls that are tested.

    And of them 99.99% of calls are absolutely unnecessary and were made only to demonstrate "lags".


If you want to do a clean test, write two identical clean examples without libraries. This will guarantee clean and no overhead built in for the sake of compatibility.

We have optimized access to the history and completely nullified this demo. It was written that way on purpose.

 
Renat Fatkhullin:

All in all:

  1. History work is in full swing, trades are closed after the history scan
Where?
  1. to use MT4Orders.mqh - is to put an end to the purity of the experiment. This is a horrible library with overhead written in a disgusting and unreadable way.
That was me.
  1. writing for(i=200 000; i>=0; i--) OrderSelect on every tick is nothing but madness and an attempt to repeat the joke about Japanese saw and Russian men exclusively
You have completely forgotten about MQL4. There is no reference to history here.
  1. the whole test was written solely for the sake of the loop from point 3

    99.99% of the challenges are completely unnecessary and were made purely to demonstrate the "brakes".
The example was not made up, there is a link to the original in the source. This is one of the best known and oldest scalpers.

If you want to do a clean test, write two identical clean examples without libraries. This way there will be a guarantee of cleanliness and no overhead built in for the sake of compatibility.

I want to be able to compare the two testers. See the pros and cons of each. Also comparison is one of the most effective ways of identifying bugs.

The thread starts with demonstrating the identity of the raw data of both testers. This is the basis, without which we can't do anything. Then everyone can choose an Expert Advisor for the test.

We have optimized access to the history and completely negated this demonstration. It was written that way on purpose.

Thanks to someone else's application the SDmade it so. Constructive criticism is a good thing.
 

Working with the history is OrderSelect and similar OrderXXXX commands. Do not pretend that you do not understand this. Especially if you have written the library.

I haven't forgotten about MQL4 and it works with history there too.

Write a history scanner for 200 000 trades deep into each tick and forget the condition of a reasonable exit from the loop? This is called - to purposely play the Russian men.

And don't refer to some scalpers. The loop was written so stupidly on purpose. And even within 5 days of the test there was nothing but hundreds of billions of OrderXXX functions being tested, of which 99.99% didn't need to be called.


The problem is that you've started to argue with the absolutely accurate statement "The entire Expert Advisor example is written so that it does only one thing - scans the entire history of trades on every tick", although you knew very well why you've written the test so intentionally. After all, you could remove 99.99% of the dumb scan with one move of your hand, but then the test would fail.
 
Renat Fatkhullin:

Working with history is OrderSelect and similar OrderXXXX commands. Do not pretend that you do not understand it. Especially if you have written the library.

I haven't forgotten about MQL4 and it works with history there too.

Write a history scanner for 200 000 trades deep into each tick and forget the condition of a reasonable exit from the loop? This is called - to purposely play the Russian men.

And don't make reference to some scalpers. The loop was written on purpose. And even within 5 days of the test it tested nothing but hundreds of billions of OrderXXXXX functions, 99.99% of which did not need to be called.

I will not argue. I ask forum users who are familiar with MQL4 to review this short source code and explain what Renat means.

Forum on Trading, Automated Trading Systems and Strategy Tests

MT4-Tester VS MT5-Tester

fxsaber, 2017.05.08 01:11

EA

// Idea - https://www.mql5.com/ru/code/7464
#property strict

input int Shift = 3; 
input int Limit = 18;
input double Lots = 0.1;

int PriceToInteger( const double Price )
{
  return((int)(Price / _Point + 0.1));
}

void OnTick()
{
  static int PrevBid = PriceToInteger(Bid);
  static int PrevAsk = PriceToInteger(Ask);    

  const int IntBid = PriceToInteger(Bid);
  const int IntAsk = PriceToInteger(Ask);
  
  const bool TradeTime = (TimeCurrent() % (24 * 60 * 60) < D'1970.01.01 23:50'); // exclude swaps
  
  if (TradeTime && (IntAsk - IntBid < Limit))
  {
    if ((IntBid - PrevBid >= Shift)) 
      OrderSend(_Symbol, OP_SELL, Lots, Bid, 0, 0, 0);
    
    if (PrevAsk - IntAsk >= Shift) 
      OrderSend(_Symbol, OP_BUY, Lots, Ask, 0, 0, 0);
  }

  PrevBid = IntBid;
  PrevAsk = IntAsk;
  
  for (int i = OrdersTotal() - 1; i >= 0; i--) 
    if (OrderSelect(i, SELECT_BY_POS) && ((!TradeTime) || (OrderProfit() > 0) ||
        ((OrderType() == OP_BUY)  && (PriceToInteger(OrderOpenPrice()) - IntBid >= Limit)) ||
        ((OrderType() == OP_SELL) && (IntAsk - PriceToInteger(OrderOpenPrice()) >= Limit)))) 
      OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 0); 
}

I must be mistaken, but I can't see where the history work in MT4 is going. Please help.

Reason: