Magaiver:
handle=FileOpen(path,FILE_CSV|FILE_WRITE,',');
FileWriteArray(handle,example,0,WHOLE_ARRAY);
FileWriteArray only works for BIN files.
Thank you for your answer. I have one more question:
How to read those bin files? Notepad gives me values like this:
ò?ffffffú?ÍÌÌÌÌÌô? @ ð? @ @ @ @ @ aTR' ‰ó?>íð×dó?B•š=Њó?9EGrùó?F%ušˆó? 4@
Probably best just to stick with the CSV file.
// FileWriteArray(handle,example,0,WHOLE_ARRAY);
for(int i=0; i<ArraySize(example); i++) FileWrite(handle,example[i]);
for(int i=0; i<ArraySize(example); i++) FileWrite(handle,example[i]);

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
I have an array (example[]), that i want to print to file. What i am doing wrong? The data.csv file appears in folder, but it's empty.
This is the code:
In main section:
input string InpFileName="data.csv";
input string InpDirectoryName="SomeFolder";
string path=InpDirectoryName+"//"+InpFileName;
double example[] = {0,5,5,5,2,1,0,4,4,4,5,7,0,0};
In OnInit section:
In OnCalculate section: