Download MetaTrader 5

FileOpen error 5004

To add comments, please log in or register
The Market has more than 400 indicators. Try any of them!
flexea
120
flexea 2016.10.25 02:22 

I have this news indicator I am calling from an EA, but occasionally it throws an error 5004 cant open xml file, yet the xml file does indeed exist. It will go days working and then all of a sudden something happens and it throws this error. Anything in this indicator code that may be a culprit?

Files:
ffcal.mq4 56 kb
Mary Clark
120
Mary Clark 2016.10.25 03:09  

Is it possible the file is open by you or by another chart/indicator ? Only one process can open a file for write at one time.

I checked and all file handles are closed. unless there is a bug in mt4 or something. Also are you sure it is the local xml file ? Or could it be the one being downloaded ? Does the problem go away on its own or do you have to do something ?

local file name. 

return (Month() + "-" + Day() + "-" + Year() + "-" + Symbol() + Period() + "-" + "FFCal.xml"); 

Cheers Mary 

flexea
120
flexea 2016.10.25 04:49  
Thank you for the reply, yes the error does seem to come and go.
Mary Clark
120
Mary Clark 2016.10.26 23:48  

Actually, I noticed the log file isn't getting closed on deinit()

 put this down right before the return(0)

  if (logHandle != -1)

      FileClose(logHandle);

return(0); 

To add comments, please log in or register