Maximum daily bars in strategy tester

 

Hey everyone, running into an issue where if I start a backtest on EURUSD D1, starting from 2023.01.01, the oldest daily bar available will be 2022.01.03, for a total of 261 bars. Is there a reason I couldn't query for let's say 500 bars from my starting date(2023.01.01) ?

I tried implementing the code from this tutorial: https://www.mql5.com/en/docs/series/timeseries_access

But it still reports first available bar to be  2022.01.03 and will not load previous bars. Is this an undocumented limitation of the strategy tester? Is this a behavior I can expect when running live?

Thank you for shedding any lights on this!


Documentation on MQL5: Timeseries and Indicators Access / Organizing Data Access
Documentation on MQL5: Timeseries and Indicators Access / Organizing Data Access
  • www.mql5.com
In this section questions connected with obtaining, storing and requesting price data ( timeseries ) are considered. Before price data become...
 
Mike D-rock:

Hey everyone, running into an issue where if I start a backtest on EURUSD D1, starting from 2023.01.01, the oldest daily bar available will be 2022.01.03, for a total of 261 bars. Is there a reason I couldn't query for let's say 500 bars from my starting date(2023.01.01) ?

I tried implementing the code from this tutorial: https://www.mql5.com/en/docs/series/timeseries_access

But it still reports first available bar to be  2022.01.03 and will not load previous bars. Is this an undocumented limitation of the strategy tester? Is this a behavior I can expect when running live?

Thank you for shedding any lights on this!


your broker either does not have history date before that date, OR your data is broken. I recommend that you delete your hst and tick data and download them again. If you continue to have your issue, then, your broker obviously does not have history data beyond that date.

 

Thanks for you reply, but if i set dates prior to that, the data is available.

Looking at this (https://www.mql5.com/en/forum/324664) other thread in the forum seems to point to the fact that this is a strategy tester limitation, and a work around would be to set dates to earlier and have the EA be in "wait" mode until the actual date you want to test arrives, which feels more like a poorman's workaround.

How to extend price History in Strtegy tester
How to extend price History in Strtegy tester
  • 2019.10.18
  • ArashB
  • www.mql5.com
Dears, first of all currently i'm using MQL5 for coding and during my coding on a strategy, i figured out there is a limited amount of history exi...
 
Mike D-rock #:

Thanks for you reply, but if i set dates prior to that, the data is available.

Looking at this (https://www.mql5.com/en/forum/324664) other thread in the forum seems to point to the fact that this is a strategy tester limitation, and a work around would be to set dates to earlier and have the EA be in "wait" mode until the actual date you want to test arrives, which feels more like a poorman's workaround.

sounds to me that your broker is missing a big chunk of history. I have history of 5 years without any issue in testing.

EDIT: i have 1 pair that is missing a couple days, but mt5 reports this missing period during the start of every test, and grabs a couple other pairs data and creates the price data from those.
 
Mike D-rock: Hey everyone, running into an issue where if I start a backtest on EURUSD D1, starting from 2023.01.01, the oldest daily bar available will be 2022.01.03, for a total of 261 bars. Is there a reason I couldn't query for let's say 500 bars from my starting date(2023.01.01) ?

It depends on which default/current time-frame you set for the test.

The Strategy Tester will usually only provide approximately 1000 bars of the current time frame (selected in the settings), and less than that for the higher time-frames.

If you need more history, then set the test period further back, and modify your EA to only start trading on the date you specify as a parameter.

 
Fernando Carreiro #:

It depends on which default/current time-frame you set for the test.

The Strategy Tester will usually only provide approximately 1000 bars of the current time frame (selected in the settings), and less than that for the higher time-frames.

If you need more history, then set the test period further back, and modify your EA to only start trading on the date you specify as a parameter.

Yea in my current scenario, the active timeframe is H4 so you might be right.

Edit: Just tested starting on the daily timeframe, and i still get only 1 year worth of bars (261 in my current case)