h=FileOpen("file.csv",FILE_WRITE|FILE_ANSI|FILE_CSV);Perhaps you should read the manual.
The function writes into a bin-file
contents of a structure passed as a parameter, starting from the current position of the file pointer.
File Functions / FileWriteStruct - Reference on algorithmic/automated trading language for MetaTrader 5
File Functions / FileWriteStruct - Reference on algorithmic/automated trading language for MetaTrader 5
Ok sometimes you are not seeing the forest for the trees but how useful is it to have the struct as a binary file as I cannot easily view it using Excel, Notpad etc.?!
So how would I write/export a struct to a CSV or text file?
Thanks for the hint. I got it working using WriteFile + a for loop to iterate over all struct entries. It is then saved as CSV file.
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
Hello,
ArrayPrint shows that array is filled correctly.
File is saved but empty.
If I use FileWrite(…) and add some strings to the file that works. So it must be specific to FileWriteStruct.
Any ideas?