strange observation about "Visual" and From/To settings in Tester

 
I noticed something weird - if you extend the From/To period, then sometimes you need to re-run the Expert with "Visual" ON! Otherwise it ignores the fact that the period was extended and only works on the portion of the period which was used before. I.e. if you initially test between 1.Oct.2006 and 31.Jan.2007 and then extend this to between 1.Aug.2006 and 31.Jan.2007 it may ignore the extension and only generate results for the initial period between oct and jan. A more detailed description of the problem follows:

I was testing my expert, gradually increasing the From/To period - I started with 1.Jan.07 to 31.Jan.07, then extended start period to 1.Dec, then to 1.Nov... etc. I did not touch end Date. It worked fine up to 1.Oct. After that it started giving me the same Balance at the end of the test for Sep, Aug, etc. I looked at the trades saw that the first trade was on 1.Oct. I then looked in the Journal and also saw that it starts running from 1.Oct??? (my expert prints starting date). I then re-ran the expert in Visual mode from 1.Sep to 1.Nov, and saw that it trades correctly, starting on 1.Sep. I then ran the test from Sep to Jan 31st and and then it worked fine. I tried August and got the same problem. In other words - it seems that for some reason it is necessary to run the expert in Visual mode otherwise it uses the old From/To period.

I used M1, GBPUSD, Open Prices Only. I did not recompile my expert at the time when this was happening. I did not check Recalculate on any of my tests and the Tester did not display the "Collecting M1.." messages. When I look in the History center - I have data from 1999 so it does not need to get new data from server or to recalculate anything (and I think it does not recalculate - it just can't detect that the from/to period was changed. Well, that's my observation anyway). One more thing I tried while trying to solve this problem - run without the "Use Date" checkbox selected, (and without Visual) hoping that this would cause the Expert to be run on the maximum available date range and thus - to force it to refresh its From/To period. But this also didn't help.It's gotta be Visual ON or else it doesn't refresh.

This may be hard to reproduce for the MQ people because they have probably ran millions of experts on their platforms, on millions of Frm/To periods... The only way to reproduce this, that I can think of is to install a fresh copy of the platform, get all needed data from server in the History center and then test. You may use my DailyTrader expert from the post about the 2-pip slippage problem from yesterday.

thanks
 

First insert Print function at the start function beginning and analyze log-file

 
I *HAVE* a print function in the start method, that is what I said in my initial post:

... I then looked in the Journal and also saw that it starts running from 1.Oct??? (my expert prints starting date).


and that's how I know it does not respect the From-To period - because the first date it prints is in Oct insted of Aug or Sep or any earlier date that I tried.

My expert (slippage-problem.zip) is posted in this thread: 'Bug? Slippage value missed by 2 pips', please feel free to take a look. Also, it looks like Rosh was having this exact same problem (need to run expert in Visual mode to get correct From/To dates) while trying to reproduce the slippage problem (5761), so it is reproducible in your computers too...
 
Here's screenshots to illustrate the problem.

Let's start with a screenshot of my history to prove that I do have all the necessary data and these problems are not because newer data must be downloaded from the server. This is my History for gbpusd, M5 - it goes back to 1999. I am testing between 01.01.2006 and 02.02.2007.

Now on to testing...

Test One - setting up a test with From/To dates - dates are not obeyed
---------------------------------------------------
1a. Setup and run a test (note the From and To dates):


1b.Here's the results of the test (Note first trade takes place on 11.April!):


1c. The journal shows that the Expert prints the first message pn the 10th of April (which agrees with the results above - first trade entered on 11.April)


1d. Same thing is confirmed by the graph - hovering the mouse in the very beginnig of the graph a date in April close 11.Apr.(it's hard to position the mouse precisely over the very first trade in the graph)


Test 2 - same as Test 1, but with "Recalculate" checked. However end result is teh same - the tester does not run from 1.Jan.2006 as required but from 10.April. 2006.
---------------------------------------------------
2a. Test setup and run


2b. Test results (note april date again)




Test No.3 - this time both Recalculate and Visual are ON. Now it works!
---------------------------------------------------------------------------
3a. Test setup and rune - Note the January dates in the visual window! It works this time!


3.b. Yes it works and this is confirmed by Results, Graph and Journal! (see pictures below)






MQ Software people, please address these problem ASAP: the Tester is the best feature of your platform! Bugs in the tester, therefore are the worst bugs in your platform. They lead to lots of wasted time, because of people testing and getting *MISLEADING* results and may even lead to loss of real money if people later try these wrong results in their live accounts! The tester is a great idea and very nice design but you really should fix all those bugs in the implementation of the tester, otherwise it's useless!


regards,
4x4ever
 

Print date at beginning of the start function. And analyze log-file. Don't use for analyze Journal tab, open log-file with notepad.exe for example.

Your fxt- sequences are not equivalent. Check "Recalculate" one time, then compare results without check "Recalculate"

 
Please explain what you mean by fxt sequences not equivalent? As you can see from screenshots I used GBPUSD M1 for all tests. And the From/To dates are also always the same as you can see. Is the History Center showing fxt-files data or something else? Is this the data which is used for back-testing in the strategy tester? (the data from the History Center?). BEcuase you have fxt fiels and hst fiels and It's a bit confusing...

The log files are gone, for some reason (should be under tester\logs, I presume, correct?). Maybe they arereplaced on every run of the tester...? I will try to reproduce the problem again tomorrow and will analyze the log files as you suggested but I am certain that the information printed in the Journal will be the same as in the logs. I'll try to reproduce this again tomorrow - the problem is that once the Recalculate+Visual works, I need to find another period for which it wil not work. Hopefully trying a month earlier should make it reproducible again.
 
Please read closely user guide, documentation, articles and this forum. Search engine works well
 
srtingo I can't search for something that I have never heard about before - I know about fxt files but this is the first time I heard the expression "fxt sequence", that's why I asked you to explain.

There is nothing about "fxt sequence" in the help of MetaEditor. After doing a search for "fxt sequence" on mql4.com and reading the 2 articles that I found, it is still not clear why is the fxt cache recalculated only after selecting Visual mode?

I attached my log file as you suggested - you can see the above results there. Search for the string
"This is the very first time start is running". There are 4 such strings in the log file, one for each of the 4 tests. I print this message from start and then set a static bool not to print it anymore.

these are the 4 tests I ran:
----------------------------
1. From 2005.06.01 to 2005.12.25, No Recalc, No Visual - works correctly, first Print call is on 2nd of June
2. From 2005.05.01 to 2005.12.25, No Recalc, No Visual - results incorrect, first Print is still on 2nd of June.
3. From 2005.05.01 to 2005.12.25, Recalc, No Visual - results still incorrect, first Print is still on 2nd of June.
4. From 2005.05.01 to 2005.12.25, Recalc, Visual - results CORRECT, first Print is on 1st of May
 

are You baby? Click on the Articles link then on the left side click on the Tester link. First article that You should read is on the 2-nd page, sorry - Strategy Tester: Modes of Modeling during Testing

2-nd article is Testing of Expert Advisors in the MetaTrader 4 Client Terminal: An Outward Glance. Then read all articles about testing.

Then search for 'fxt' keyword https://www.mql5.com/en/search and read all the searched topics. You can search for 'fxt sequence' too https://www.mql5.com/en/search. You ask questions that have answers already.

You can open fxt-file offline and analyze it yourself.

I suspect You get 3 different fxt files 1-2 first file, 3 - second file, 4 - third file. Additional historical data was downloaded and next recalculate You get different data. Open previously charts with data used in your testing, make sure that all data is present, then start your testing




 
Because I am not a baby I will not go down to your level and will not call you names.

What we have here is an obvious BUG:
Inputs: Recalculate=ON, Visual=OFF; Result: wrong dates
Inputs: Recalculate=ON, Visual=ON; Result: correct dates
Conclusion: From/To dates are only refreshed when using Visual.
I don't know how much simpler I can say it so it registers with you.

I spend hours to setup my tests, to reproduce the bugs, to generate the screenshots and the log files and to post them on this forum, at the same time trying to word my posts as polite as possible so I don't offend somebody. Do you think I like wasting my time or do you think I do this to make you look bad as a programmer? The easiest thing for me is to remember that if I want new From/To dates - I need to select Visual. I try to help you, with best intentions and with the idea to make MT4 a better and more user-friendly software for all of us and what I get in return is "baby".

When I get bug reports treat them as opportunity to make our software better, not as personal attacks on my skills as a programmer. Because I know that nobody is God and we all make mistakes and we all write buggy code sometimes. Now this is a bug. It is your choice whether to fix it or not. If you don't intend to fix bugs in the near future - fair enough. Just say it. "Right now we will not be fixing bugs because we have other priorities - new releases, new software... etc". I can understand that. But don't send me off to read articles which have NOTHING in common with the problem I am reporting.

And I bet you didn't even try to reproduce this problem.
 
Welcome to the wonderful world of MQL support :)
I posted a bunch of bugs on here and just got ignored, then one of Metaquotes fan boys gave me a reeming in another forum for suggesting MetaTrader even had bugs!!
Once you get past the dates thing you will probably find your backtest data is complete garbage anyway, you have to backtest with Alphari data & MetaTrader offline so that it does not try to 'blend' together different data sources, that my friend, is the real killer.
Reason: