Download MetaTrader 5

CopyTicks & error 4014

To add comments, please log in or register
Icham Aidibe
10672
Icham Aidibe  

Hi,

To gather ticks infos, I use the code provided by mql5 with the strategy tester on EURUSD, M1, quality 100% :

/--- the array that receives ticks
   MqlTick tick_array[];
//--- requesting ticks
   int copied=CopyTicks(_Symbol,tick_array,COPY_TICKS_ALL,0,ticks);
//--- if ticks are received, show the Bid and Ask values on the chart  
   if(copied>0)
     {
      string comment="#  Time       Bid        Ask\r\n";
      //--- generate the comment contents      
      for(int i=0;i<copied;i++)
        {
         MqlTick tick=tick_array[i];
         string tick_string=StringFormat("%d: %s  %G  %G",
                                         i,
                                         TimeToString(tick.time,TIME_MINUTES|TIME_SECONDS),
                                         tick.bid,
                                         tick.ask);
         comment=comment+tick_string+"\r\n";
        }
        //--- show a comment on the chart        
        Comment(comment);
     }
   else // report an error that occurred when receiving ticks
     {
      Comment("Ticks could not be loaded. GetLastError()=",GetLastError());
     }
  }

And that's simply the error I'm getting :

2016.02.25 11:23:44.434 2016.02.01 09:24:09   Ticks could not be loaded. GetLastError()= 4014

Anyone to help there ?

Roberto Jacobs
49047
Roberto Jacobs  
Icham Aidibe:

Hi,

To gather ticks infos, I use the code provided by mql5 with the strategy tester on EURUSD, M1, quality 100% :

And that's simply the error I'm getting :

Anyone to help there ?


What is the total number of variables ticks?

//--- requesting ticks
   int copied=CopyTicks(_Symbol,tick_array,COPY_TICKS_ALL,0,ticks); // int ticks=?
Alain Verleyen
Moderator
34557
Alain Verleyen  
CopyTicks() doesn't work in the Strategy Tester. Anyway it doesn't make sense to use it with the Strategy Tester.
Roberto Jacobs
49047
Roberto Jacobs  
Alain Verleyen:
CopyTicks() doesn't work in the Strategy Tester. Anyway it doesn't make sense to use it with the Strategy Tester.
Alain, please explain, why CopyTicks() doesn't work on the Strategy Tester?
Icham Aidibe
10672
Icham Aidibe  
Roberto Jacobs:

What is the total number of variables ticks?

I use 5 for tests.
Icham Aidibe
10672
Icham Aidibe  
Alain Verleyen:
CopyTicks() doesn't work in the Strategy Tester. Anyway it doesn't make sense to use it with the Strategy Tester.
Is there any alternative if you wish to work with ticks ?
Alain Verleyen
Moderator
34557
Alain Verleyen  
Icham Aidibe:
Is there any alternative if you wish to work with ticks ?

Work with ticks in the Strategy Tester ? There is no missed ticks there so CopyTicks is useless. If you want to work with ticks the Strategy Tester is useless, it's not real ticks but calculated ones.

The "alternative" is to work on live chart or eventually record the ticks yourself.

To add comments, please log in or register