int h1; h1 = FileOpen("trade_length.csv",FILE_CSV | FILE_WRITE |FILE_READ,";");Print("h1 = ",h1); if(h1<0) { Print("unable to open file trade_length.csv ",GetLastError()); return(false); } FileSeek(h1,0,SEEK_END); FileWrite(h1,High[1],Low[1],Close[1],Volume[1]); FileClose(h1);

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi all;
this is likely something really dumb, the following code is right out of the forum, except i've added Print in order to debug and .
So... compiles ok,... when run ....h1 is equal to -1, which means function failed and GetLastError is 4103 "cannot open file".... duh.
So the error is evidently in the h1 = FileOpen... line, but I'm damned if I can see anything wrong with it and the documents do
not indicate anything else that I need to do, i.e. the file is created by the ea when needed, I do not have to create it seperately.
Ideas, hints, suggestions, wild hunches and the correct solution all deeply appreciated.
Keith