FileOpen problem...

 

I testing a EA an i have in source FileOpen function.

Then this EA run in terminal it can write in file.

Then i run it in Startegy Tester, the EA don't write anything.

Can you help me ?

 
 

FileOpen does not work on the weekend either

Hi

I was trying out file functions during the week and they worked fine - then I sat down Saturday to try some file functions - and nothing works. I figure it is because the 'int start()' function is only called on a new trade - so with no trading - there is nothing to kick of the program. Or am I totally confused?

 

int start works in Saturdays.

cardio:
Hi I was trying out file functions during the week and they worked fine - then I sat down Saturday to try some file functions - and nothing works. I figure it is because the 'int start()' function is only called on a new trade - so with no trading - there is nothing to kick of the program. Or am I totally confused?

Hi cardio,

int start() does not work only when receiving new quotations (which is disabled at Saturdays) but it works too when you attach your EA or CI to the chart, when you change the charts periodicity, when you refresh the chart and a lot of other cases.

To be sure of what am I saying, try this code where OpenFile and int start have worked with me in Saturday:

int start()

{

Alert("I'm working even in Saturdays!"); //are you working in Saturdays?

int handle;

handle=FileOpen("test.txt",FILE_BIN|FILE_WRITE);

if(handle<1) //there's an error opening the file

{

Alert(ErrorDescription( GetLastError()));

}

else

{

Alert("file has been opened");

FileWrite(handle,"hi");

FileClose(handle);

}

}

So I think there's something wrong with those functions.

Do you have any code to test?

 

something must be wrong with interbankfx on the weekend

Hi - first off thanks for all the great lessons, I will post some comments on them now.

I tried your code, during the weekend and did not even get your first alert - saying "I'm working even in Saturdays!". So interbankfx must shut down their system over the weekend.

When I tried it when interbankfx market was open your code worked - so that proves it.

 

MetaTrader 4\tester\files

twinsen:
I testing a EA an i have in source FileOpen function.

Then this EA run in terminal it can write in file.

Then i run it in Startegy Tester, the EA don't write anything.

Can you help me ?

Finally Metaquotes has revealed the secret , Please find the file in MetaTrader 4\tester\files Directory.

 

Files handling replacement DLL

I created a Files handling replacement DLL - built with Visual C++.

https://www.mql5.com/en/forum/173113

Reason: