FileWrite warning

To add comments, please log in or register
ms239
29
ms239  

Hi

i want Create a file but my parameters is to much and I'm faced with this warning : FileWrite - wrong parameters count

I want all the parameters to be written horizontally

How can I fix this warning?

ms239
29
ms239  
   
void OnTick()
  {

if(iVolume(Symbol(),PERIOD_M1,0) <= 1)
{   
   string file_name= "DATA.csv";
   int file_handle = -1;  
   file_handle=FileOpen(file_name,FILE_WRITE|FILE_READ|FILE_CSV|FILE_SHARE_READ|FILE_ACCESS_DATE|FILE_IS_WRITABLE|FILE_IS_READABLE);
   if(file_handle==INVALID_HANDLE)
      Print("Error opening rep-file: "+file_name);
//---
   FileSeek(file_handle,0,SEEK_END);
         FileWrite(file_handle,           
                   "pos_1","pos_2","pos_3","pos_4","pos_5","pos_6","pos_7","pos_8","pos_9","pos_10","pos_11","pos_12","pos_13","pos_14",
                   "pos_15","pos_16","pos_17","pos_18","pos_19","pos_20","pos_21","pos_22","pos_23","pos_24","pos_25","pos_26","pos_27","pos_28",
                   "pos_29","pos_30","pos_2","pos_31","pos_32","pos_33","pos_34","pos_35","pos_36","pos_37","pos_38","pos_39","pos_40","pos_41",
                   "pos_42","pos_43","pos_44","pos_45","pos_46","pos_47","pos_48","pos_49","pos_50","pos_51","pos_52","pos_53","pos_54","pos_55",
                   "pos_56","pos_57","pos_58","pos_59","pos_60","pos_61","pos_62","pos_63","pos_64","pos_65","pos_66","pos_67","pos_68","pos_69",
                   "pos_70"
                   );
   FileFlush(file_handle);
   FileClose(file_handle);
   


}
   
  }
this is my code  
Marcin Madrzak
510
Marcin Madrzak  
ms239:

Check documentation of FileWrite (it's very easy, just set the cursor to function name nad press F1).

"The number of written parameters can be up to 63."

ms239
29
ms239  
Marcin Madrzak:

Check documentation of FileWrite (it's very easy, just set the cursor to function name nad press F1).

"The number of written parameters can be up to 63."

Is there any way to create a file with a horizontal length greater than 63?

lippmaje
614
lippmaje  
ms239:

Is there any way to create a file with a horizontal length greater than 63?

You can build a string with StringFormat.

string line=StringFormat("%s,%s,%s,%s,%s","pos_1","pos_2","pos_3","pos_4","pos_5");
line=StringFormat("%s,%s,%s,%s,%s,%s",line,"pos_6","pos_7","pos_8","pos_9","pos_10");
...
FileWriteString(file_handle,line);
nicholi shen
2393
nicholi shen  
You should really flip your axis. "pos_n" should be on a row not a column. 
ms239
29
ms239  
lippmaje:

You can build a string with StringFormat.

thank you
To add comments, please log in or register