MT5 Tester bug report

 
Yesterday (02. Sep.), MT5 was updated to new version by Liveupdate.
After that, My EA does not work in MT5 tester.

I checked the reason, I found MT5 tester reports incorrect Deal history.

Please refer below log.


In the first, EA opened a position with two pending order.

2010.01.28 00:00:00   instant buy 1.00 AUDUSD at 0.89681 (0.89648 / 0.89681 / 0.89648)
2010.01.28 00:00:00   deal #2 buy 1.00 AUDUSD at 0.89681 done (based on order #2)
2010.01.28 00:00:00   deal performed [#2 buy 1.00 AUDUSD at 0.89681]
2010.01.28 00:00:00   order performed buy 1.00 at 0.89681 [#2 buy 1.00 AUDUSD at 0.89681]
2010.01.28 00:00:00   sell stop 1.00 AUDUSD at 0.88970 (0.89648 / 0.89681 / 0.89648)
2010.01.28 00:00:00   sell limit 1.00 AUDUSD at 1.02789 (0.89648 / 0.89681 / 0.89648)

And check Deal History, MT5 tester reports incorrect results.
Total Deal Number is "2". It should be "1".
And it reports one same Deal as different two deal.

2010.01.28 00:00:00   /////////////////////////////////////////////////////////////////////
2010.01.28 00:00:00   //////  Total Deal Number=2
2010.01.28 00:00:00   //////  Deal #0   Deal Ticket=2
2010.01.28 00:00:00   //////  InitialLot=1
2010.01.28 00:00:00   //////  Price=0.89681
2010.01.28 00:00:00   //////  Time=2010.01.28 00:00
2010.01.28 00:00:00   ////// --------------------------------------------------------------
2010.01.28 00:00:00   //////  Deal #1  Deal Ticket=2
2010.01.28 00:00:00   //////  InitialLot=1
2010.01.28 00:00:01   //////  Price=0.89681
2010.01.28 00:00:01   //////  Time=2010.01.28 00:00
2010.01.28 00:00:01   /////////////////////////////////////////////////////////////////////


and EA cancel Pending orders and place again.


2010.01.29 02:00:00   order canceled [#30 sell limit 2.00 AUDUSD at 1.02965]
2010.01.29 02:00:00   order canceled [#29 sell stop 2.00 AUDUSD at 0.89050]
2010.01.29 02:00:01   sell stop 1.00 AUDUSD at 0.89050 (0.89383 / 0.89415 / 0.89383)
2010.01.29 02:00:01   sell limit 1.00 AUDUSD at 1.02965 (0.89383 / 0.89415 / 0.89383)


After that, Deal number is changed to "1" from "2". Why????


2010.01.29 02:00:01   /////////////////////////////////////////////////////////////////////
2010.01.29 02:00:01   //////  Total Deal Hisotry Number=1
2010.01.29 02:00:01   //////  Deal #0   Deal Ticket=2
2010.01.29 02:00:01   //////  InitialLot=1
2010.01.29 02:00:01   //////  Price=0.89681
2010.01.29 02:00:01   //////  Time=2010.01.28 00:00
2010.01.29 02:00:01   /////////////////////////////////////////////////////////////////////


I checked various pattern, after pending order place/cancel, Deal history number is changed.
Please fix this issue.
Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Deal Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Deal Properties - Documentation on MQL5
 

Could you provide EA source, settings of Strategy tester to make us able to reproduce problem? You can use private messages or servicedesk to do this.

MQL5.community - User Memo
  • 2010.02.25
  • MetaQuotes Software Corp.
  • www.mql5.com
You have just registered and most likely you have questions such as, "How do I insert a picture to my a message?" "How do I format my MQL5 source code?" "Where are my personal messages kept?" You may have many other questions. In this article, we have prepared some hands-on tips that will help you get accustomed in MQL5.community and take full advantage of its available features.
 
The messy OnTrade() on Strategy Tester
  • www.mql5.com
Selected deal ticket 1 having entry 0 in the HistorySelect queueHN 0 OnTradeStressTest (EURUSD,M1) 12:29:55 2010.
 

I attached the test EA on this comment for this issue.

You can find the phenomenon, if you run this EA in ther tester.

You need to run very short time, only one day history.  (for example  EURUSD H1 charts   start 2010.09.01  end 2010.09.02) 

 I found this problem is happened when specify the start time of HistorySelect;

ex.

  HistorySelect( dealTime, TimeCurrent())  -->  NG

  HistorySelect( 0, TimeCurrent())   --> OK

 

And this EA can check another issues related Deal/Modify command.

You may need to remove OrderCheck function from Trade.mqh. 


 PS. I found another issue. In MT5 tester,  "EventKillTimer()" never kill the timer.

Files: