Download MetaTrader 5

CopyLow or CopyHigh make some ticks skipped in backtester

To add comments, please log in or register
Order the development and track its status via your mobile phone.
Jean-Luc Plagnaud
300
Jean-Luc Plagnaud 2010.08.25 17:44 

First of all I know that in the journal a lot of info is missing and I have to check the agent logs.

I am talking about the agent logs here.

When I have my code without CopyLow or CopyHigh I see all ticks called

If I do

   ArraySetAsSeries(Low,true);
   if (CopyLow(_Symbol,PERIOD_M1,1,60*2,Low) != 60)
   {
      Print("CopyLow of ",_Symbol," failed, no history");
      return;
   }

then I see 1h of ticks "disappearing". 


I don't uderstnad why retrieving data in the past will make me miss the ticks


Did I miss something or is it weird?

Samuel Olowoyo
2241
Samuel Olowoyo 2010.08.27 20:23  
jlpi:

First of all I know that in the journal a lot of info is missing and I have to check the agent logs.

I am talking about the agent logs here.

When I have my code without CopyLow or CopyHigh I see all ticks called

If I do

   ArraySetAsSeries(Low,true);
   if (CopyLow(_Symbol,PERIOD_M1,1,60*2,Low) != 60)
   {
      Print("CopyLow of ",_Symbol," failed, no history");
      return;
   }

then I see 1h of ticks "disappearing". 


I don't uderstnad why retrieving data in the past will make me miss the ticks


Did I miss something or is it weird?


Hi,

Maybe you should just adjust the CopyLow code to look like below using <60 instead of !=60

if (CopyLow(_Symbol,PERIOD_M1,1,60*2,Low) < 60)
   {
      Print("CopyLow of ",_Symbol," failed, no history");
      return;
   }

 

Jean-Luc Plagnaud
300
Jean-Luc Plagnaud 2010.08.31 13:45  
olowsam:

Hi,

Maybe you should just adjust the CopyLow code to look like below using <60 instead of !=60

 

But the issue is not that this part of code is not working, it is working, I have no errors.

The issue is that after the code is executed, the tester behaves like it will skip 1 hour of tick (like it doesn't call the code for a number of tick equivalent to 1h)

I can see in the Agent logs that the ticks that are normally present are skipped.

Is there anybody from Metaquotes that could answer this question in order to help people to migrate from MQL4 to MQL5?

Migrating from MQL4 to MQL5
  • 2010.05.17
  • Sergey Pavlov
  • www.mql5.com
This article is a quick guide to MQL4 language functions, it will help you to migrate your programs from MQL4 to MQL5. For each MQL4 function (except trading functions) the description and MQL5 implementation are presented, it allows you to reduce the conversion time significantly. For convenience, the MQL4 functions are divided into groups, similar to MQL4 Reference.
To add comments, please log in or register