I manage to resolve it by changing
filehandle=FileOpen(csvfilename,FILE_READ|FILE_CSV,",");
to
filehandle=FileOpen(csvlastequityfilename,FILE_READ);
Alain Verleyen:
noted
bobo1974:
noted
Why dont you do what Alain suggest. It makes your code more "readable".
noted
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
Hi all,
I have a csv file with 2 variable, equity and time stamp as shown below
10494,2016.05.06 23:55
When i try to read the content of the csv file using the script below, it gave me only the equity (10494) which is the "text" variable
How do i read the whole string which is 10494,2016.05.06 23:55 ?
Thanks
##############
void ReadCurrentEquityTimeFromFile(){
int filehandle=0;
string text;
for (int i=0;i<5;i++){
filehandle=FileOpen(csvfilename,FILE_READ|FILE_CSV,",");
if(filehandle!=INVALID_HANDLE) break;
Sleep(1000);
}
if(filehandle!=INVALID_HANDLE)
{
text = FileReadString(filehandle,0);
}
FileFlush(filehandle);
FileClose(filehandle);
}