I have to apologize my readers, MQLmagazine is not coming in august too -> see here why :(

 

I was reluctant to do this, but I was advised to go public with this issue and tell you guys the cause for which we are delaying so much.

Thing is, a lot of complex researches, that involved me getting into advanced mathematics, are staying because of the issues encountered with Strategy Tester.

I don't have any kind of answer from MetaQuotes for about two weeks, that including answers to messages, not even something like "Be patient", not talking about answers to tickets.

In this interval, MT advanced from build 306 to build 313 without me seeing any answers or improvements.

Now, as I write these lines, I updated to build 314. Same issues. Slightly different, but same issues.

So I'll show you what I reported and MetaQuotes never answered for:

First ticket 

Problem description

I was attempting to solve a problem from the WhiteNoiseTester - seemed that some arrays were filled with 0s. To track it down, I set the class to write the values from the arrays (each subgroup).

This is an excerpt of the log:

KO 0 Core 1 19:28:20 2010.01.04 22:57:00 Portfolio: EURGBP-GBPJPY . Now loading data>>>>>>>>>>>>>> Loaded=1360 max 1440
MM 0 Core 1 19:28:20 2010.01.04 22:57:00 port = 5
CI 0 Core 1 19:28:20 2010.01.04 22:57:00 Currencies: EUR GBP CHF
PO 0 Core 1 19:28:21 2010.01.05 00:19:00 Data[49]=0
JD 0 Core 1 19:28:21 2010.01.05 00:19:00 Data[50]=0
CM 0 Core 1 19:28:21 2010.01.05 00:19:00 Data[51]=0


But it's not the same: this is the same area from a previous run:

HH 0 Core 1 18:50:50 2010.01.04 19:57:00 Portfolio: EURUSD-USDJPY . Now loading data>>>>>>>>>>>>>> Loaded=1180 max 1440
OL 0 Core 1 18:50:50 2010.01.04 19:57:00 port = 2
MG 0 Core 1 18:50:51 2010.01.05 00:19:00 Data[65]=0

and it continues....

PF 0 Core 1 18:50:55 2010.01.05 00:19:00 Data[143]=0
JR 0 Core 1 18:50:55 2010.01.05 00:19:00 ...stddev = 0
HD 0 Core 1 18:50:56 2010.01.05 00:19:00 Setting up last subgroup
OR 0 Core 1 18:50:56 2010.01.05 00:19:00 ...copies from 1296 (144 values)
GF 0 Core 1 18:50:56 2010.01.05 00:19:00 ...calculates indicators
QO 0 Core 1 18:50:56 2010.01.05 00:19:00 Data[0]=0

...

So the contents for 8 groups was not displayed, the contents for 9th group started from 65, and the content for last group is listed.

As you see, last portfolio displayed there during construction is 5, but the statistical tests are made on portfolio 0, after data loading is finished. But last portfolio is 14 or something like that - obviously not even loading for this is reflected in the log.

This is the Nth time when I raise an alarm about missing log data. Will we ever be able to trust that the tester is at least executing code correctly ? Because it's obvious that backtesting itself has limits - but at least a correct run of the code should be expected. This problem never existed in MT4 - but the backtester was too limited. I have to trust that the logs are correct in order to analyse a strategy - I can't add to this the difficulty of not trusting that the code run was correct!

Also I don't know exactly why I have 0 values inside the arrays, because I output the data from the initial arrays and made the file for script version of the Bartlett test. I presume it might be my coding, though a bug is not excluded.

Note: one run today, build 314, even had some data. But the log contained previous stuff. So I deleted the log and ran again. This time no data. It has different outputs from a run to another, probably memory issues.

 Files for this one:

 script_run.log

bartlett_strategytester.log

bartlett_st_build314.log

 

 Second ticket

 Problem description

After seeing some strange problems with some EAs, I decided to tackle the OnTrade issue with a specially designed EA.

The EA is opening pending buys and sells (one buy, one sell). I even modified my own DealHandler class specially to see what's happening.

This is an excerpt of the log:

KF 0 Core 1 21:44:33 performance: 64
LK 0 Core 1 21:44:33 EURUSD: symbol synchronized, 3304 bytes of symbol info received
OD 0 Core 1 21:44:35 EURUSD: load 27 bytes of history data to synchronize
OL 0 Core 1 21:44:35 EURUSD: history synchronized from 1993.05.13 to 2010.08.09
OE 0 Core 1 21:44:36 2010.01.04 00:00:00 ::There were previous reports. Selected deal ticket 1 having entry 0 in the HistorySelect queue
HF 0 Core 1 21:44:36 2010.01.04 00:00:00 ::Selected ticket is LastDealTicket (reported) (=1)
JG 0 Core 1 21:44:36 2010.01.04 00:00:00 ::Enumerating from 0 to 0 included
NN 0 Core 1 21:44:36 2010.01.04 00:00:00 Index 0 ticket=1 : DEAL_TYPE_BUY
HD 0 Core 1 21:44:36 2010.01.04 00:00:00 OnTrade() reporting to duty!

So. First entry is a DEAL_TYPE_BUY instead of a DEAL_TYPE_BALANCE!

Notice that I wrote OnTrade like this:

void OnTrade()
 {
 Print("OnTrade() reporting to duty!");
 DealHandlerDevice.ReportDeals();
 }



So, after the intro line "OL 0 Core 1 21:44:35 EURUSD: history synchronized from 1993.05.13 to 2010.08.09" and before the ReportDeals text, "OE 0 Core 1 21:44:36 2010.01.04 00:00:00 ::There were previous reports. Selected deal ticket 1 having entry 0 in the HistorySelect queue", we should have had "OnTrade() reporting to duty!". But does not appear! The one that appears, after ReportDeals() call, is from another OnTrade() execution - who knows what for, because

after 3 repeats of the previous block, comes this:

OF 0 Core 1 21:44:37 2010.01.04 10:31:04 ::History loaded and has 3 entries. Looking for LastDealTicket=1
KK 0 Core 1 21:44:37 2010.01.04 10:31:04 ::There were previous reports. Selected deal ticket 1 having entry 0 in the HistorySelect queue
DD 0 Core 1 21:44:37 2010.01.04 10:31:04 ::Selected ticket is LastDealTicket (reported) (=1)
DE 0 Core 1 21:44:37 2010.01.04 10:31:04 ::Enumerating from 0 to 2 included
FQ 0 Core 1 21:44:37 2010.01.04 10:31:04 Index 0 ticket=1 : DEAL_TYPE_BUY
FF 0 Core 1 21:44:37 2010.01.04 10:31:04 Index 1 ticket=2 : DEAL_TYPE_BALANCE
RL 0 Core 1 21:44:37 2010.01.04 10:31:04 Index 2 ticket=3 : DEAL_TYPE_BUY
PR 0 Core 1 21:44:37 2010.01.04 10:31:04 OnTrade() reporting to duty!

So, first entry is a BUY, balance is SECOND ENTRY!

Also, which execution is the one that Index 2 line references ?

GI 0 Core 1 21:44:37 2010.01.04 10:31:04 ::History loaded and has 3 entries. Looking for LastDealTicket=1
CO 0 Core 1 21:44:37 2010.01.04 10:31:04 ::There were previous reports. Selected deal ticket 1 having entry 0 in the HistorySelect queue
LI 0 Core 1 21:44:37 2010.01.04 10:31:04 ::Selected ticket is LastDealTicket (reported) (=1)
LP 0 Core 1 21:44:37 2010.01.04 10:31:04 ::Enumerating from 0 to 2 included
ND 0 Core 1 21:44:37 2010.01.04 10:31:04 Index 0 ticket=1 : DEAL_TYPE_BUY
NJ 0 Core 1 21:44:37 2010.01.04 10:31:04 Index 1 ticket=2 : DEAL_TYPE_BALANCE
JP 0 Core 1 21:44:37 2010.01.04 10:31:04 Index 2 ticket=3 : DEAL_TYPE_BUY

This just repeated.... Ok, never mind. We finally have executions:

JD 0 Core 1 21:44:37 2010.01.04 10:35:34 order [#4 buy stop 0.10 EURUSD at 1.43768] triggered
NE 0 Core 1 21:44:38 2010.01.04 10:35:34 deal #4 buy 0.10 EURUSD at 1.43768 done (based on order #4)
HO 0 Core 1 21:44:38 2010.01.04 10:35:34 deal performed [#4 buy 0.10 EURUSD at 1.43768]
OS 0 Core 1 21:44:38 2010.01.04 10:35:34 order performed buy 0.10 at 1.43768 [#4 buy stop 0.10 EURUSD at 1.43768]
FE 0 Core 1 21:44:38 2010.01.04 10:35:34 OnTrade() reporting to duty!
DH 0 Core 1 21:44:38 2010.01.04 10:35:34 ::History loaded and has 4 entries. Looking for LastDealTicket=1
IM 0 Core 1 21:44:38 2010.01.04 10:35:34 ::There were previous reports. Selected deal ticket 1 having entry 0 in the HistorySelect queue
RN 0 Core 1 21:44:38 2010.01.04 10:35:34 ::Selected ticket is LastDealTicket (reported) (=1)
QO 0 Core 1 21:44:38 2010.01.04 10:35:34 ::Enumerating from 0 to 3 included
LG 0 Core 1 21:44:38 2010.01.04 10:35:34 Index 0 ticket=1 : DEAL_TYPE_BUY
PL 0 Core 1 21:44:38 2010.01.04 10:35:34 Index 1 ticket=2 : DEAL_TYPE_BALANCE
HR 0 Core 1 21:44:38 2010.01.04 10:35:34 Index 2 ticket=3 : DEAL_TYPE_BUY
PE 0 Core 1 21:44:38 2010.01.04 10:35:34 Index 3 ticket=4 : DEAL_TYPE_SELL

So: Deal performed, it is a buy, we have the OnTrade() call with the right text, "OnTrade() reporting to duty!", then an enumeration.

I see the BALANCE is the second, guess that is the deposit, that means the larger the index the nearer to the current time. Are there any sells? Then how is the last one a sell?

JN 0 Core 1 21:44:38 2010.01.04 10:35:34 OnTrade() reporting to duty!
HE 0 Core 1 21:44:38 2010.01.04 10:35:34 ::History loaded and has 4 entries. Looking for LastDealTicket=1
MK 0 Core 1 21:44:38 2010.01.04 10:35:34 ::There were previous reports. Selected deal ticket 1 having entry 0 in the HistorySelect queue
FE 0 Core 1 21:44:38 2010.01.04 10:35:34 ::Selected ticket is LastDealTicket (reported) (=1)

and then suddenly:

FK 0 Core 1 21:44:39 2010.01.05 06:49:24 order performed buy 0.10 at 1.44568 [#8 buy stop 0.10 EURUSD at 1.44568]

The enumeration block just vanished!

Then for last execution comes "OnTrade reporting to duty!"

OM 0 Core 1 21:44:39 2010.01.05 06:49:24 OnTrade() reporting to duty!
IP 0 Core 1 21:44:39 2010.01.05 06:49:24 ::History loaded and has 8 entries. Looking for LastDealTicket=1
LE 0 Core 1 21:44:39 2010.01.05 06:49:24 ::There were previous reports. Selected deal ticket 1 having entry 0 in the HistorySelect queue
CF 0 Core 1 21:44:39 2010.01.05 06:49:24 ::Selected ticket is LastDealTicket (reported) (=1)
HG 0 Core 1 21:44:39 2010.01.05 06:49:24 ::Enumerating from 0 to 7 included
EO 0 Core 1 21:44:39 2010.01.05 06:49:24 Index 0 ticket=1 : DEAL_TYPE_BUY
ED 0 Core 1 21:44:39 2010.01.05 06:49:24 Index 1 ticket=2 : DEAL_TYPE_BALANCE
IK 0 Core 1 21:44:39 2010.01.05 06:49:24 Index 2 ticket=3 : DEAL_TYPE_BUY
EM 0 Core 1 21:44:39 2010.01.05 06:49:24 Index 3 ticket=4 : DEAL_TYPE_SELL
CF 0 Core 1 21:44:39 2010.01.05 06:49:24 Index 4 ticket=5 : DEAL_TYPE_BUY
OQ 0 Core 1 21:44:39 2010.01.05 06:49:24 Index 5 ticket=6 : DEAL_TYPE_SELL
ME 0 Core 1 21:44:39 2010.01.05 06:49:24 Index 6 ticket=7 : DEAL_TYPE_BUY
IF 0 Core 1 21:44:39 2010.01.05 06:49:24 Index 7 ticket=8 : DEAL_TYPE_SELL

Again...it's ending with a SELL, and we have last one a buy? Oh...but previous history had 4 entries. Shouldn't have 5 now?

Oh, and don't think I am so stupid to mistake the HistorySelect: loaded=HistorySelect(0,TimeCurrent()+5*60);

Can anybody explain this? Or make a class to enumerate executions since last enumeration?

But better - make a decent OnTrade! Something with parameters - ticket, symbol, type, volume, price, magic, comment!

This way it will be a normal mechanism!


Additional details

I remember, the normal DealHandler class was working normally on forward testing (actually it was trapping manual trades correctly, in the order that they were made).

So, problems reside in the tester. And it's really a pity!

 

Right now, at build 314, runs differently, I would say in a more twisted manner.I cannot understand, under any circumstances, why OnTrade() has no parameters. The computer supports anything! If the MT client or the Strategy Tester know which trade has been executed, and are able to raise the OnTrade event, it can be raised with parameters, such as ticket, symbol, type, price, magic, comment!

In these conditions, even the championship becomes pointless - if we can't even rely on the strategy tester at least for a correct run of the code and complete log reporting!

Files:

 stresstest.log

stresstest314.log 

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
 
 

 My God !

Mql5 still have a lot of error,  this will make  Championship  not so justice.

Maybe still need Mql4 to   Championship .

Automated Trading Championship 2010
  • championship.mql5.com
Automated Trading Championship 2010
 
DxdCn:

 My God !

Mql5 still have a lot of error,  this will make  Championship  not so justice.

Maybe still need Mql4 to   Championship .

This certainly will complicate the work of trading systems, but after all for all participant of the championship...
 
DxdCn:

 My God !

Mql5 still have a lot of error,  this will make  Championship  not so justice.

Maybe still need Mql4 to   Championship .

yes, so we have many concern for metatrader 5 / MQL5.

platform debugging, trading systems , and EA.

but it will fair when compete for $ 80 K for first place not for total.

 
TheEconomist:

So I'll show you what I reported and MetaQuotes never answered for:

First ticket 

Problem description

I was attempting to solve a problem from the WhiteNoiseTester - seemed that some arrays were filled with 0s. To track it down, I set the class to write the values from the arrays (each subgroup).


We have checked your request and couldn't reproduced your result. We advised you to see agents logs then , have you done it?


 

Rosh, you know I'm a quite impulsive and quick when I'm nervous, but that doesn't mean I am stupid. Of course I sent you genuine .log files not .txt files with logs Copy-Paste made logs from the Journal tab.

 I didn't see the answer from Aug 17, because there was no bug icon near the "Profile" button. But you taught me the log files stuff on July 21, so I couldn't be sending you copy-pastes from journal:

 

I am attaching the video proof that the issue can be reproduced - in fact, I reproduce it every time I click on Start.

I think the log problem is the first thing on the agenda. If the logs are not correct, then nothing can be trusted.

However, the OnTrade() and HistorySelect() issue is also very important, because any trading station must have a trade event mechanism and a valid history reporting. Now, if OnTrade() doesn't trigger at the moment it should, then it screws the entire backtest for EAs that act based on OnTrade() reports. Second, if the history contents retrieved with HistorySelect() is a gibberish that doesn't look like the trades reported in the meanwhile, it doesn't mean we are dumb and we don't understand history, it means the tester's history mechanism is bugged! I mean, I quite trust OnTrade() and HistorySelect() on forward testing, but I don't have any trust in this mechanism in the tester. Add some holes to the logs and the recipe for confusion becomes perfect!

And one more thing, when you can't mimic what I am sending you, just answer me that you can't, don't let me wait like a moron! 

Files:
mt5_video.zip  6032 kb
 
TheEconomist:

Rosh, you know I'm a quite impulsive and quick when I'm nervous, but that doesn't mean I am stupid. Of course I sent you genuine .log files not .txt files with logs Copy-Paste made logs from the Journal tab.

I am attaching the video proof.


Unfortunately I could not open your archive.
 

I tested and mine opens. Ok, I made it again and loaded.

 

Files:
mt5_video2.zip  6027 kb
 

Now I can see. You should look for agent log in other folder according your video.



 
Here is my tester log. There is no one record like
CM 0 Core 1 19:28:21 2010.01.05 00:19:00 Data[51]=0

Files:
20100822.log  96 kb
 
Which OS do you have? Is it 32 or 64 bit version?