Questions from a "dummy" - page 189

 
Yedelkin:

So this error also occurs on a demo account(not in the tester)?

And it is better to read about the history for testing in the "Testing of trading strategies" section.

I do not really understand what "on a demo account (not in the tester)" means.

My file/login is the new test account of MetaQuotes-Demo server.

I go to the strategy view/tester. I start my Expert Advisor from 01.01.2012 and get error.

I have been implementing it since 01.01.2011 up to today. Everything is running without any problems.

 
MegaVoin: I don't really understand what "on a demo account (not a tester)" means.
Well, it's simple. Open a chart on a demo account with the required symbol-period pair (e.g. EURUSD, 10 min) and attach your Expert Advisor to this chart. Then look at the logs under "Tools" (Ctrl+T), "Experts" tab.
 
MegaVoin:

I go to view/strategy tester. I start my EA from 01.01.2012, I get error.

I start it from 01.01.2011 till today. Everything is running without any problems.

Read about testing basics: https://www.mql5.com/ru/articles/239


Quotation:

The testing agent downloads only the missing history with a small margin to provide the necessary data on the history to calculate the indicators at the start of testing. The minimum amount of history to be downloaded from the trade server for timeframes D1 and less is one year. So, if we start testing on the interval 2010.11.01-2010.12.01 (testing on the interval of one month) with the period M15 (each bar is 15 minutes), the terminal will request the history for the whole year 2010.

Основы тестирования в MetaTrader 5
Основы тестирования в MetaTrader 5
  • 2011.03.28
  • MetaQuotes Software Corp.
  • www.mql5.com
В чем различия между тремя режимами тестирования в MetaTrader 5 и на что обратить внимание? Как происходит тестирование эксперта, торгующего одновременно на нескольких инструментах? Когда и как вычисляются значения индикаторов при тестировании и как обрабатываются события? Как синхронизировать бары с разных инструментов при тестировании в режиме "Только цены открытия"? Статья призвана дать ответы на эти и многие другие вопросы.
 
Yedelkin:
Well, it's easy. Open a chart on a demo account with the needed symbol-period pair (for example, EURUSD, 10 min) and attach your Expert Advisor to this chart. Then look at the logs in "Tools" (Ctrl+T), "Experts" tab.

It works. Logged the result of the calculation of this function. Outputs every tick, the result is similar to the truth.

So the glitch is in the tester.

 
MegaVoin: It works. Logged the result of the calculation of this function. Outputs every tick, the result is similar to the truth.
Well, that's good! :) Now try to look through the links about testing, mentioned above. They are similar, the text of the article was moved to the Reference.
 
Yedelkin:
Well, that's good! :) Now try to look through the links about testing described above. They are similar, the text of the article has been moved to the Reference.

I have read it carefully. All I got was that if something is not loaded, it will be loaded automatically when the data is accessed.

I solved the problem in a different way. However, I don't like this way of solving the problem too much. I had changed _Period in the entire program to PERIOD_M10 and changed the timeframe in the tester from 10 minutes to 1 month.

Документация по MQL5: Стандартные константы, перечисления и структуры / Константы графиков / Периоды графиков
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы графиков / Периоды графиков
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы графиков / Периоды графиков - Документация по MQL5
 
MegaVoin: I have read it carefully. All I got was that if something is not loaded, it will be loaded automatically when accessing the data.
It says that "the testing agent receives the history for the tested symbol from the terminal". Below it says that the terminal can forcibly download the history and provides a link. In order not to bother with the question whether the desired depth of the history is available, you can try to insert the script of forced loading of the history with the necessary timeframe into the OnInit() function of the program and see the result. I.e., see if this script downloads the history of monthly timeframes when working in the tester.
 
script to force the downloading of history с указанием нужного таймфрейма

They suggest calling SymbolSelec, but unfortunately there is no timeframe when you call it :(

bool  SymbolSelect(
   string  name,       // имя символа
   bool    select      // включить или выключить
   ); 

 
MegaVoin: They suggest calling SymbolSelecе, but unfortunately there is no timeframe when you call it :(
bool  SymbolSelect(
   string  name,       // имя символа
   bool    select      // включить или выключить
   );

The script in question is "intCheckLoadHistory(string symbol,ENUM_TIMEFRAMES period,datetime start_date)".

It is stated here https://www.mql5.com/ru/docs/series/timeseries_access

Документация по MQL5: Доступ к таймсериям и индикаторам / Организация доступа к данным
Документация по MQL5: Доступ к таймсериям и индикаторам / Организация доступа к данным
  • www.mql5.com
Доступ к таймсериям и индикаторам / Организация доступа к данным - Документация по MQL5
 
Yedelkin:

The script in question is "intCheckLoadHistory(string symbol,ENUM_TIMEFRAMES period,datetime start_date)".

It's available here https://www.mql5.com/ru/docs/series/timeseries_access

I will try it later.

Thank you very much for your help!

Reason: