Download MetaTrader 5

Error 4807 new build 687

To add comments, please log in or register
Nick Rios
199
Nick Rios  

Hey there:

Before this build i was able to copy indicator buffers the way the first code is written, after this build i starteg getting the error 4807 when i ran the strategy tester, so i decided to debug the code to see which one of the indicators i was having trouble with, so i re wrote the code like the second part and the error just dissapeared, can someone explain me why is this happening??

//BEFORE BUILD 687
if(CopyBuffer(StochHandle,0,0,250,StochVal)<0 || CopyBuffer(SlowRunnerHandle,0,0,250,SlowRunnerVal)<0
   || CopyBuffer(MAUPHandle,0,0,250,MAUPVal)<0 || CopyBuffer(MADNHandle,0,0,250,MADNVal)<0
    || CopyBuffer(FastRunnerHandle,0,0,250,FastRunnerVal)<0 || CopyBuffer(MATPHandle,0,0,250,MATPVal)<0)
   {
      Alert("Error copying indicator Buffers - error:",GetLastError(),"!!");
      ResetLastError();
      return;
   }
//AFTER BUILD 687
if(CopyBuffer(StochHandle,0,0,250,StochVal)<0)
   {
      Alert("Error copying indicator Buffers - error:",GetLastError(),"!!");
      ResetLastError();
      return;
   }
   if(CopyBuffer(SlowRunnerHandle,0,0,250,SlowRunnerVal)<0)
   {
      Alert("Error copying indicator Buffers - error:",GetLastError(),"!!");
      ResetLastError();
      return;
   }
   if(CopyBuffer(MAUPHandle,0,0,250,MAUPVal)<0)
   {
      Alert("Error copying indicator Buffers - error:",GetLastError(),"!!");
      ResetLastError();
      return;
   }
   if(CopyBuffer(MADNHandle,0,0,250,MADNVal)<0)
   {
      Alert("Error copying indicator Buffers - error:",GetLastError(),"!!");
      ResetLastError();
      return;
   }
   if(CopyBuffer(FastRunnerHandle,0,0,250,FastRunnerVal)<0)
   {
      Alert("Error copying indicator Buffers - error:",GetLastError(),"!!");
      ResetLastError();
      return;
   }
   if(CopyBuffer(MATPHandle,0,0,250,MATPVal)<0)
   {
      Alert("Error copying indicator Buffers - error:",GetLastError(),"!!");
      ResetLastError();
      return;
   }
Documentation on MQL5: Timeseries and Indicators Access / CopyBuffer
Documentation on MQL5: Timeseries and Indicators Access / CopyBuffer
  • www.mql5.com
Timeseries and Indicators Access / CopyBuffer - Documentation on MQL5
To add comments, please log in or register