Errors, bugs, questions - page 805

 
ilunga:
So, there is a code on the previous page where there is an array of 3 elements. When you output it with Prints, you get that Bid = 1.29709 while bar_info[n-1] stores 1.29220

What do you think of this?

//----------------------------------------------------------------------------//
//Work variables
int ResCopy = -1; //Result of copying the data into an array

datetime bar_info[5];

bool Result = true; //Returned importance
//----------------------------------------------------------------------------//

ResetLastError();

//Checking the signal to stopping the trading system
  if(IsStopped()) return(false);
ZeroMemory(CheckResult);
//Copying the data into an array
ResCopy = CopyTime(symbol,period,0,ArraySize(bar_info),bar_info);

  if(ResCopy==-1)return(false); 
//
  for(int f=0;f<ResCopy;f++)
  {
  Print("f=",f,"-",TimeToString(bar_info[f]));
  }
//Checking for presence of the errors
  if(_LastError!=0){Result = false;}
 
Interesting:

What do you make of this?

If this is run from an init, then

HS      0       test4 (GBPUSD,H1)       14:56:20        2012.01.01 00:00:00   f=0-2011.12.26 00:00
PD      0       test4 (GBPUSD,H1)       14:56:20        2012.01.01 00:00:00   f=1-2011.12.27 00:00
LN      0       test4 (GBPUSD,H1)       14:56:20        2012.01.01 00:00:00   f=2-2011.12.28 00:00
DG      0       test4 (GBPUSD,H1)       14:56:20        2012.01.01 00:00:00   f=3-2011.12.29 00:00
II      0       test4 (GBPUSD,H1)       14:56:20        2012.01.01 00:00:00   f=4-2011.12.30 00:00

If from OnTick, then

DJ      0       test4 (GBPUSD,H1)       14:57:13        2012.01.02 09:00:00   f=0-2011.12.27 00:00
JL      0       test4 (GBPUSD,H1)       14:57:13        2012.01.02 09:00:00   f=1-2011.12.28 00:00
PE      0       test4 (GBPUSD,H1)       14:57:13        2012.01.02 09:00:00   f=2-2011.12.29 00:00
OO      0       test4 (GBPUSD,H1)       14:57:13        2012.01.02 09:00:00   f=3-2011.12.30 00:00
FP      0       test4 (GBPUSD,H1)       14:57:13        2012.01.02 09:00:00   f=4-2012.01.02 00:00

I have a gap in the data at this point (see picture). Still, I have a feeling that when testing on another pair, I get asynchronous data update


 

It is.

Add one more line after the Prints:

Print("Время последней котировки:" + TimeToString(SymbolInfoInteger("EURUSD", SYMBOL_TIME)));


When running code in OnTick we get:

RK      0       test4 (GBPUSD,H1)       15:06:31        2012.01.02 09:00:00   f=0-2011.12.27 00:00
LR      0       test4 (GBPUSD,H1)       15:06:31        2012.01.02 09:00:00   f=1-2011.12.28 00:00
FD      0       test4 (GBPUSD,H1)       15:06:31        2012.01.02 09:00:00   f=2-2011.12.29 00:00
EO      0       test4 (GBPUSD,H1)       15:06:31        2012.01.02 09:00:00   f=3-2011.12.30 00:00
PQ      0       test4 (GBPUSD,H1)       15:06:31        2012.01.02 09:00:00   f=4-2012.01.02 00:00
OI      0       test4 (GBPUSD,H1)       15:06:31        2012.01.02 09:00:00   Время последней котировки:2011.12.30 20:59

That is, bar for Copy...() already exists, but there is no quote in it yet.



We can make another addition. Insert your function with my addition into OnTick:

if (TimeCurrent() < D'2012.01.10 15:00') return;

Test run from 2012.01.01

we get:

RO      0       test4 (GBPUSD,H1)       15:20:13        2012.01.10 15:00:00   f=0-2012.01.04 00:00
JQ      0       test4 (GBPUSD,H1)       15:20:13        2012.01.10 15:00:00   f=1-2012.01.05 00:00
RH      0       test4 (GBPUSD,H1)       15:20:13        2012.01.10 15:00:00   f=2-2012.01.06 00:00
LR      0       test4 (GBPUSD,H1)       15:20:13        2012.01.10 15:00:00   f=3-2012.01.09 00:00
QE      0       test4 (GBPUSD,H1)       15:20:13        2012.01.10 15:00:00   f=4-2012.01.10 00:00
ON      0       test4 (GBPUSD,H1)       15:20:13        2012.01.10 15:00:00   Время последней котировки:2011.12.30 20:59
LS      0       test4 (GBPUSD,H1)       15:20:13        2012.01.10 15:00:20   f=0-2012.01.04 00:00
DE      0       test4 (GBPUSD,H1)       15:20:13        2012.01.10 15:00:20   f=1-2012.01.05 00:00
LL      0       test4 (GBPUSD,H1)       15:20:13        2012.01.10 15:00:20   f=2-2012.01.06 00:00
RF      0       test4 (GBPUSD,H1)       15:20:13        2012.01.10 15:00:20   f=3-2012.01.09 00:00
KI      0       test4 (GBPUSD,H1)       15:20:13        2012.01.10 15:00:20   f=4-2012.01.10 00:00
FR      0       test4 (GBPUSD,H1)       15:20:13        2012.01.10 15:00:20   Время последней котировки:2012.01.10 15:00
FG      0       test4 (GBPUSD,H1)       15:20:13        2012.01.10 15:00:40   f=0-2012.01.04 00:00
NN      0       test4 (GBPUSD,H1)       15:20:13        2012.01.10 15:00:40   f=1-2012.01.05 00:00
FP      0       test4 (GBPUSD,H1)       15:20:13        2012.01.10 15:00:40   f=2-2012.01.06 00:00
HK      0       test4 (GBPUSD,H1)       15:20:13        2012.01.10 15:00:40   f=3-2012.01.09 00:00
EM      0       test4 (GBPUSD,H1)       15:20:13        2012.01.10 15:00:40   f=4-2012.01.10 00:00
LE      0       test4 (GBPUSD,H1)       15:20:13        2012.01.10 15:00:40   Время последней котировки:2012.01.10 15:00


That is, the first quote is glitchy, the rest are correct

 
ilunga:

If this is run from an inite, then

HS      0       test4 (GBPUSD,H1)       14:56:20        2012.01.01 00:00:00   f=0-2011.12.26 00:00
PD      0       test4 (GBPUSD,H1)       14:56:20        2012.01.01 00:00:00   f=1-2011.12.27 00:00
LN      0       test4 (GBPUSD,H1)       14:56:20        2012.01.01 00:00:00   f=2-2011.12.28 00:00
DG      0       test4 (GBPUSD,H1)       14:56:20        2012.01.01 00:00:00   f=3-2011.12.29 00:00
II      0       test4 (GBPUSD,H1)       14:56:20        2012.01.01 00:00:00   f=4-2011.12.30 00:00

The last bar (closest to the current date) will have the maximum index in this case.

 
ilunga:
So the first quote is glitchy, the others are correct.
Thank you. (chuckles) We have found the error, we will fix it.
 

Can you tell me what the zeros before the comma in the Pass column mean?


 
My second digit is now gone, just zeros.
 
tol64:

Can you tell me what the zeros before the comma in the Pass column mean?


This is the genetics generation number. Not only are there zeros, after the zeros come 1, 2 etc.
 
marketeer:
This is the generation number of the genetics. There are not only zeros, after zeros come 1, 2 etc.

Does mine mean it's not breeding? )))

Generations are coming, but the column is still full of zeros.

 

Are these additions possible in MT5?

In struct MqlTradeResult add the time of order execution on the server side.

And add the possibility to set the time at which a pending order becomes active for server execution.

Документация по MQL5: Стандартные константы, перечисления и структуры / Структуры данных / Структура результата торгового запроса
Документация по MQL5: Стандартные константы, перечисления и структуры / Структуры данных / Структура результата торгового запроса
  • www.mql5.com
Стандартные константы, перечисления и структуры / Структуры данных / Структура результата торгового запроса - Документация по MQL5