Errors, bugs, questions - page 85

 
Rosh:
It is written about it in section Organization of data access

I've tried it now... In the tester I can't load history, but in the demo it's a breeze...

Or maybe I did it wrong.

In general, is it realistic to push start and the Expert Advisor "let me download not much history"?

 
gumgum:

Here I've tried it now... I can't load history in tester, but in demo...

It just couldn't occur to us that someone would misrepresent the teachings of MQL5 in such a way. Considering what the terminal help says, what else is needed?


 
Rosh:

It just couldn't occur to us that someone would misrepresent the teachings of MQL5 in such a way. Considering what the terminal help says, what else is needed?


I probably didn't put it correctly.

All the data is downloaded, it's all there.

I have tested from 2010.01.01 to today (H1).

There is such a line in my Expert Advisor:

Print("Самая первая дата по символу-периоду на данный момент =",
         (datetime)SeriesInfoInteger(Symbol(),0,SERIES_FIRSTDATE));

The log says " First date by character-period so far = 2009.01.02 00:00:00".

I asked how to make it lower than 2009.01.02 00:00:00.

I got an answer:

Ido not need all of the history:

1 Tester ensures loading of at least 100 bars of the tested timeframe before the start date of testing.

2 The tester will load history from at least the beginning of the previous year from the test start date.

If you select a monthly timeframe, you will be provided with 8 years of history data. If you select a weekly timeframe, you will get 2 years. Just do not use the current timeframe when analyzing signals, but explicitly specify the timeframe you need.

Monthly one takes a long time because it loads all the history, but what do I need all the history for?

 

gumgum:

Monthly takes a long time to load because it loads all the history, and why should I need all the history...

The whole history

So download it to the terminal as much as you need (even from 1993 to Eurasia), and then the tester won't even ask about the depth of history.

If you're testing on external agents, then yes, the data will be synchronized (if it's not the right depth).

The initial bar

Since 2009.01.02 at H1 there is a huge amount of redundant data (ok, not redundant, but there are almost 9 000 Hour bars). Why more?

 

How would one have to go about it, knowing the id number of a position, to select it?

   HistorySelectByPosition(position_id);
   PositionSelect(HistoryDealGetString(HistoryDealGetTicket(0),DEAL_SYMBOL));

Can't you just make a function to select a position by its id ??????

Документация по MQL5: Торговые функции / PositionSelect
Документация по MQL5: Торговые функции / PositionSelect
  • www.mql5.com
Торговые функции / PositionSelect - Документация по MQL5
 
Urain:

I mean, how much trouble would one have to go through to select a position number knowing its id?

Can't you just make a function to select a position by its id ??????

Oh, it's a miracle, it turns out you can overload predefined functions.

bool PositionSelect(long position_id)
  {
   if(HistorySelectByPosition(position_id))
     return(PositionSelect(HistoryDealGetString(HistoryDealGetTicket(0),DEAL_SYMBOL)));
   else return(false);  
  }

or is it a bug ???

I checked it all works, I wonder if this feature will not disappear in the future ???

I've fixed it to a safer variant.

 
Interesting:

The whole history

Well, load it into the terminal as long as you need (at least from 1993 to Eura), and then the tester won't even ask about the depth of history.

If testing will be done on external agents, then yes, the data will be synchronized (if it does not turn out to be the right depth).

The initial bar

Since 2009.01.02 at H1 there is a huge amount of redundant data (ok, not redundant, but there are almost 9 000 Hour bars). Why more?


The entire history is loaded! I need it to gather statistics for opening Pisces.
 
Urain:

Oh wonder, it turns out you can overload predefined functions.

or is this a bug ???

I checked it all works, I wonder if this feature will disappear in the future ???

I fixed it to a safer variant.

I think not. Overloading of standard functions is better to do not on direct, but through their declaration in classes...
 
gumgum:
The history is all downloaded! I need it to collect statistics for opening pizicions.

9,000 hour bars not a statistic?

PS

Then at the moment there is only one remedy - in the EA parameters we add indication of date, starting from which to trade, and postpone the start of the test, say, to a desired depth (with this approach until there is enough bars for analysis, the work will not start)...

Документация по MQL5: Доступ к таймсериям и индикаторам / Bars
Документация по MQL5: Доступ к таймсериям и индикаторам / Bars
  • www.mql5.com
Доступ к таймсериям и индикаторам / Bars - Документация по MQL5
 
Interesting:

9,000 hour bars not a statistic?

PS

Then at the moment there is only one remedy - in the parameters of the Expert Advisor we add indication of which date to trade from, and postpone the start of the test, say, to a desired depth (with this approach, until there is a sufficient number of bars for analysis, the work will not start)...

Hourly and daily. This is how I do it. Another way out is to create data files (which I am doing now).
Reason: