CopyTicks & error 4014

 

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 ?

 
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=?
 
CopyTicks() doesn't work in the Strategy Tester. Anyway it doesn't make sense to use it with the Strategy Tester.
 
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?
 
Roberto Jacobs:

What is the total number of variables ticks?

I use 5 for tests.
 
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 ?
 
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.

 
Place Real Ticks in execution mode. It will do.
 
Alain Verleyen:

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.

why can't we use copyTicks in the tester ?

i got an indicator that uses the copyTicks function of MT5 to display a line.

When used in Tester, the first few bars are completely off due to the inability to gather data previous to the current bar. If i make a simple MA, i need previous data to create the first value ! I need precise tick data to calculate my indi, i cannot do it without, with only OHLC

so what's the solution to this ? i can only hide the first few bar computation in the tester because they are not right but that's not a solution i'm totally comfortable with.

please change this, thanks

Jeff

 
Elmo de Moraes:
Place Real Ticks in execution mode. It will do.

doesn't work for me

 
Jean Francois Le Bas:

why can't we use copyTicks in the tester ?

i got an indicator that uses the copyTicks function of MT5 to display a line.

When used in Tester, the first few bars are completely off due to the inability to gather data previous to the current bar. If i make a simple MA, i need previous data to create the first value ! I need precise tick data to calculate my indi, i cannot do it without, with only OHLC

so what's the solution to this ? i can only hide the first few bar computation in the tester because they are not right but that's not a solution i'm totally comfortable with.

please change this, thanks

Jeff

Try it before posting.

This is an obsolete thread/post, real ticks are now available in the Strategy Tester, and CopyTicks is working fine.

Reason: