Errors, bugs, questions - page 82

 
gumgum:

I'm putting in a test from 2010.01.01 to today. I output the date of the very first bar 2009.01.02.

How can I make the first available bar be e.g. 2006.01.02?

2006.01.02, why not 2010.01.01?

And what do we know about the seriality of arrays?

 
Interesting:

2006.01.02, why not 2010.01.01?

And what do we know about array serialisation?

I want to make sure that when testing, historical data is sufficient. How to do this?

Can we allow in the code to trade from a certain date and choose a longer testing period, but otherwise?

 
gumgum:

I want to make sure that when testing, there is enough historical data. How can this be done?

Can I allow in the code to trade from a certain date and choose a longer testing period, but otherwise?


When initializing, check if the history is available on the server and on your own. If the history needs to be loaded, do it immediately (in the initialization block)...

And seriality (its absence) in the given question will show from where to count 0 bar...

 

Dear colleagues and language developers, could you please explain the following situation?

There are two structures (senior and junior), the constructor of senior is called by start(),

constructor of junior is called by constructor of senior structure.

How to pass a variable from senior structure to constructor of junior structure ??????????

struct Ml
  {
   int               a;
   int               b;
   void Ml()
     {
      if(f)a=1; else a=2; // ?????????????????????????????      
      if(F)b=2; else b=3; // ?????????????????????????????        
     };
   void ~Ml(){};
   void m(){};
  };
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
struct St
  {
   bool              f;  // ?????????????????????
   bool              F;  // ?????????????????????
   Ml               x[];
   void St(){f=true; F=false; ArrayResize(x,1); x[0].m();};  // ?????????????????????
   void ~St(){};
   int          mult(int i){ArrayResize(x,i+1);return(x[i].a*x[0].b);};
   int           add(int i){ArrayResize(x,i+1);return(x[i].a+x[0].b);};
  };
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnStart()
  {
   St x[];
   ArrayResize(x,2);

   int Mult=x[1].mult(10);
   int Add=x[1].add(10);

   Print("x[1].mult(10)=",x[1].mult(10),"  x[1].add(10)=",x[1].add(10));
  }
//+------------------------------------------------------------------+
 
Interesting:

When initialising, check if the history is available on the server and on your own. If you need to load the history, do it immediately (in the initialisation block)...

And seriality (its absence) in this question will show from where to count 0 bar...

check https://www.mql5.com/ru/docs/series/seriesinfointeger like this ? How to load (poke your nose in the right direction)?
Документация по MQL5: Доступ к таймсериям и индикаторам / SeriesInfoInteger
Документация по MQL5: Доступ к таймсериям и индикаторам / SeriesInfoInteger
  • www.mql5.com
Доступ к таймсериям и индикаторам / SeriesInfoInteger - Документация по MQL5
 
gumgum:

I want to make sure that when testing, there is enough historical data. How can this be done?

Can I allow in the code to trade from a certain date and choose a longer testing period, but otherwise?

1. The tester provides loading of at least 100 bars of the timeframe under test before the start date of testing.

2 The tester loads the history from at least the beginning of the previous year from the start date of testing.

If you select a monthly timeframe, you will be provided with 8 years of history. 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.

 
stringo:

1 The tester ensures that at least 100 bars of the timeframe under test are loaded prior to the test start date.

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. If you select a weekly timeframe, you will get 2 years. Just use not the current timeframe when analyzing signals, but explicitly specify the timeframe you need.

put it like this:

Waiting for.... I'm still at 3.3% neither here nor there:

 
Urain:

Dear colleagues and language developers, could you please explain the following situation?

There are two structures (senior and junior), the constructor of senior is called by start(),

constructor of junior is called by constructor of senior structure.

How to pass a variable from senior structure to constructor of junior structure ??????????



I think a real life example would be more understandable:

When a new position appears, a new object is created, which includes a dynamic array of pointers to deals.

Since in the initial situation, the position has only one deal, its data are written into the appropriate structure during initialization of the object,

but the structure constructor receives the ticket number from the position object.

And it is not clear how to pass this ticket?

At global variable declaration there are no problems,

the position is selected, the ticket is written and the object is constructed,

The structure is designed in the object and all get the same ticket globally,

both deals and positions (because the first-opening deal in the ticket is equal to the position id),

but when you try to remove global ticket declaration, problems start.

 
gumgum:

put it like this:

I'm waiting for.... 3.3% of the time, no way in, no way out:

Data download? What's in the test log?
 
stringo:
Loading data? What's in test log?

At the moment 5.6%

2010.08.06 13:08:52 Core 1 EURUSD,Daily: history begins from 2001.01.01 00:00
2010.08.06 13:08:52 Core 1 EURUSD,Daily: history cache reserved for estimated 2411 bars
2010.08.06 13:08:52 Core 1 EURUSD: contains 3208261 M1 records of beginning data from 2001.01.01 00:01 to 2009.12.31 18:59
2010.08.06 13:05:58 para.06 13:05:58 Core 1 para=EURUSD
2010.08.06 13:05:58 Core 1 delta=0.10
2010.08.06 13:05:58 Core 1 fc=0.19
2010.08.06 13:05:58 Core 1 M=11
2010.08.06 13:05:58 Core 1 dis=0.11
2010.08.06 13:05:58 Core 1 EURUSD,Monthly: testing of experts\slivarobot.ex5 from 2010.01.01 00:00 to 2010.03.31 00:00 started with inputs:
2010.06.08.06 13:05:58 Core 1 EURUSD,Monthly: 1 minutes OHLC ticks generating
2010.08.06 13:05:58 Core 1 EURUSD,Monthly: history starts from 2001.01.01 00:00
2010.08.06 13:05:58 Core 1 EURUSD,Monthly: history cache reserved for estimated 120 bars
2010.08.06 13:05:58 Core 1 EURUSD: contains 3208261 M1 records of beginning data from 2001.01.01 00:01 to 2009.12.31 18:59
2010.08.06 13:03:13 Core 1 EURUSD: history synchronized from 1993.05.13 to 2010.08.05
2010.08.06 13:03:13 Core 1 EURUSD: load 27 bytes of history data to synchronize
2010.08.06 13:03:11 Core 1 EURUSD: symbol synchronized. 3304 bytes of symbol info received.
2010.08.06 13:03:11 Core 1 Performance: 31
2010.08.06 13:03:11 Core 1 39 Kb of total initialization data received
2010.08.06 13:03:11 Core 1 Successfully initialized
2010.08.06 13:03:11 Core 1 Initial deposit 10000.00 USD
2010.08.06 13:03:11 Core 1 Expert file added: Libraries\BSCAI.ex5. 3277 bytes loaded
2010.08.06 13:03:11 Core 1 Expert file added: Libraries\PNNOCHL(slivarobot).ex5. 13083 bytes loaded
2010.08.06 13:03:11 Core 1 Expert file added: Experts\slivarobot.ex5. 3598 bytes loaded
2010.08.06 13:03:11 Core 1 275 bytes of selected symbols loaded
2010.08.06 13:03:11 Core 1 7178 bytes of tester parameters loaded
2010.08.06 13:03:11 Core 1 3780 bytes of group info loaded
2010.08.06 13:03:11 Core 1 3124 bytes of account info loaded
2010.08.06 13:03:11 Core 1 Common synchronization completed
2010.06.08.06 13:03:07 Tester EURUSD,Monthly: testing of experts\slivarobot.ex5 from 2010.01.01 00:00 to 2010.03.31 00:00 to be started
2010.08.06 13:03:07 Core 1 Authorized (agent build 302)
2010.08.06 13:03:07 Core 1 Connected
2010.08.06 13:03:06 Core 1 Connecting to 127.0.0.1:3000
2010.08.06 13:03:06 Core 1 Agent process started