Error 5004

 

I am getting this error despite declaring the tester_file in my EAs header and the file queried is physically present in the MQL5\Files directory. I am launcing MT5 with the /portable suffix in the shortcut. Here is my code.

 

//+------------------------------------------------------------------+
//|                                                           EA.mq5 |
//|                        Copyright 2014, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property version   "1.00"
#property tester_file   "_DATA.bin";

  
struct _STRUCT_P_4
  {
      double p_1_mn1;
  };
  
_STRUCT_P_4  _read[1],_write[];
  
input bool           _tester_read   =  false;
input bool           _tester_write  =  false;


//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+

int OnInit()
  {

   //--- create timer
  
    EventSetTimer(60);
   
   if(_tester_write){    
      int _write_handle=FileOpen("_DATA.bin",FILE_READ|FILE_BIN);
      if(_write_handle!=INVALID_HANDLE){
         FileReadArray(_write_handle,_write,0,WHOLE_ARRAY);
         FileClose(_write_handle);
         for(int i=0; i<ArraySize(_write); i++){
            Print("... ");}}
      else if(_write_handle==INVALID_HANDLE){ Print(" invalid handle... ",GetLastError()); }}
   
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   
  }
//+------------------------------------------------------------------+
 
coder_xx:

I am getting this error despite declaring the tester_file in my EAs header and the file queried is physically present in the MQL5\Files directory. I am launcing MT5 with the /portable suffix in the shortcut. Here is my code.

 

The binary file is 27mb. Is there a size limit for this to work? Smaller files of about 4mb are being accessed ok.
 
coder_xx:
The binary file is 27mb. Is there a size limit for this to work? Smaller files of about 4mb are being accessed ok.
You have this error when running your code with Strategy Tester or on a live chart or both ?
 
angevoyageur:
You have this error when running your code with Strategy Tester or on a live chart or both ?
When running strategy tester. I only use it with strategy tester.
 
coder_xx:
When running strategy tester. I only use it with strategy tester.

I am not aware of a file size limit. Maybe the file isn't copied to testing environment.

If you can send the date file I can check it, otherwise I don't see how to help you.

 
Coder_xx, sorry if this a basic question, but are you sure your file is at your MT5 data folder and not at your MT5 installation one?