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.
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?
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!
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!
Hi
I have a problem in my current project, and i have seen that is related with this thread.
At the beginining of testing, i have seen that bar history in tester is limited to 1 year, and not depends ni of Account nor Terminal.
It could be verified with:
datetime firstServerDate; SeriesInfoInteger(_Symbol,PERIOD_M1,SERIES_SERVER_FIRSTDATE,firstServerDate);
Is posible to change initial availability of history?
Thanks
Start earlier and wait until your real starting date.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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?