Download MetaTrader 5

Filewrite to csv and fileread to array from csv

To add comments, please log in or register
Quantum Capital International Group Ltd
207
Yang Chih Chou  

does any one can help me to do 

i have two array , array A & array B 

if i want to save array A data to csv then read from csv and to write to array B

how can i code it,thank you!

that is my code blow 

thank you! 

"writefile"
handle=FileOpen(filename,FILE_CSV|FILE_READ|FILE_WRITE);
     
     FileWrite(handle,EntryTrade[0],TimeToStr(EntryTrade[1],TIME_DATE|TIME_SECONDS),EntryTrade[2],EntryTrade[3],EntryTrade[4],EntryTrade[5]
     ,EntryTrade[6],EntryTrade[7],EntryTrade[8],EntryTrade[9],EntryTrade[10],EntryTrade[11],EntryTrade[12],EntryTrade[13]);
     FileClose(handle);


"readfile"

handle=FileOpen(filename,FILE_CSV|FILE_READ);
     FileReadArray(handle,HoldingOrder,0,WHOLE_ARRAY);
     FileClose(handle);
sangmane
35
sangmane  
handle=FileOpen(filename,FILE_CSV|FILE_READ); 

string holdingArray[14];

for (int i=0; i<ArraySize(holdingArray); i++) {

        holdingArray[i] = FileReadString(handle);

        if (FileIsEnding(handle)) break;

}

FileClose(handle); 
To add comments, please log in or register