Guys,
I use the routine below to write a log file of data with a timestamp - worked perfectly for a few hours..then next day all parameters were written to file EXCEPT the timestamp which was ZERO! WTF!!
What am I doing wrong or is there a ghost in the machine?
thanks
... neither of these is the fault in question, but from the definition of FileOpen only a -1 is a fail so in theory ==0 is a possibility, meaning the handle > 0 test may fail.
Also "_logfile" + ".csv" seems strange.
Why not "_logfile.csv" ?
The second parameter is wrong in your code. You are using Day().
It is working by accident at first by the looks of it.
thanks for the reply - I agree "_logfile" + ".csv" is clunky - probably remnants of changing code. The 'handle' outcome doesn't fail because it writes all other parameters when asked except the time stamp. This was the original output 2012.02.15 21:16:20 but today I noticed it has written a time stamp again (after doing nothing for a day) but only the date and not the time!(2012.02.17) Weird! I haven't changed any code.
Just changed the code to your format and works OK so thanks very much.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Guys,
I use the routine below to write a log file of data with a timestamp - worked perfectly for a few hours..then next day all parameters were written to file EXCEPT the timestamp which was ZERO! WTF!!
What am I doing wrong or is there a ghost in the machine?
thanks