Download MetaTrader 5
To add comments, please log in or register
Create interesting Forum topics concerning the automated trading!
Fernando Carreiro
1437
Fernando Carreiro 2014.02.18 15:52 

While doing a back-test on one of my current projects I discovered an oddity in the Strategy Tester but don’t know if this is new behaviour or if this is an old thing which I never noticed before.

I was having some strange results that did not coincide with expectations and during the debug phase I noticed that an MA calculation with a very long period (2880) was returning 0 during the initial stages.

After further debugging I found the initial available Bar History (first starting time/date) was very low (hence the MA of 2880 not calculating correctly) and did not coincide with the settings for the number of available bars in charts and in history which in my case I have set to the maximum.

Even though I have history data for every timeframe for way back, during the back-test, the number of history bars seems to be very, very limited. In fact, dumping the “Bars” variable on the first tick on various symbols and time frames, its value varies between 1000 and 1200 bars, far fewer than what I have available and set in the options.

Can anyone else confirm or deny such behaviour on their systems or if this is an adjustable condition that can be set somewhere?

forexrunner
148
forexrunner 2014.02.18 16:06  
FMIC:

While doing a back-test on one of my current projects I discovered an oddity in the Strategy Tester but don’t know if this is new behaviour or if this is an old thing which I never noticed before.

I was having some strange results that did not coincide with expectations and during the debug phase I noticed that an MA calculation with a very long period (2880) was returning 0 during the initial stages.

After further debugging I found the initial available Bar History (first starting time/date) was very low (hence the MA of 2880 not calculating correctly) and did not coincide with the settings for the number of available bars in charts and in history which in my case I have set to the maximum.

Even though I have history data for every timeframe for way back, during the back-test, the number of history bars seems to be very, very limited. In fact, dumping the “Bars” variable on the first tick on various symbols and time frames, its value varies between 1000 and 1200 bars, far fewer than what I have available and set in the options.

Can anyone else confirm or deny such behaviour on their systems or if this is an adjustable condition that can be set somewhere?


This is an old behaviour. Initially you only have 1000 bars. Search in this forum for this issue, because I had the same doubt and a few searches in this forum gave me the solution.
whroeder1
13597
whroeder1 2014.02.18 16:08  

Pre-build 6xx the tester guaranteed 100 bars and would give 1000 if you had history before the start date. Unless you pre-download history, on live charts, my broker only sends 2K bars.

So 2880 doesn't work in either case. Why don't you go up a timeframe, and reduce the period by that factor?

Fernando Carreiro
1437
Fernando Carreiro 2014.02.18 18:37  
yokinfx:

This is an old behaviour. Initially you only have 1000 bars. Search in this forum for this issue, because I had the same doubt and a few searches in this forum gave me the solution.

Thank you for the information!
Fernando Carreiro
1437
Fernando Carreiro 2014.02.18 18:41  
WHRoeder:

Pre-build 6xx the tester guaranteed 100 bars and would give 1000 if you had history before the start date. Unless you pre-download history, on live charts, my broker only sends 2K bars.

So 2880 doesn't work in either case. Why don't you go up a timeframe, and reduce the period by that factor?


No need! It is not important! I was just playing around with an idea when I noticed this oddity.

MetaQuotes, however should have defined a setting for this in the "Options", just like one has for the number of bars in Charts and History!

/
To add comments, please log in or register