Hello all the gurus!!
I wrote a simple and straight EA
string filename;
int handle;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
filename = "myfile.csv";
handle = FileOpen(filename,FILE_CSV|FILE_WRITE);
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
FileClose(handle);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int handle = FileOpen(filename,FILE_CSV|FILE_WRITE|FILE_READ);
if (FileWrite(handle,"yy")<0)
{Print("error writing file");}
else
{Print("filewrite time successful @ ");}
FileClose(handle);
return(0);
}
//+----------
I expect it to write ""yy" into a file |expertsfilesmyfile.csv and thought EA runs (icon smiles), I don't have any output, even a file is not created inside expertfile directory.
Could anyone comment on what I miss here?
Your help would be much appreciated indeed!
Thank you!
I wrote a simple and straight EA
string filename;
int handle;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
filename = "myfile.csv";
handle = FileOpen(filename,FILE_CSV|FILE_WRITE);
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
FileClose(handle);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int handle = FileOpen(filename,FILE_CSV|FILE_WRITE|FILE_READ);
if (FileWrite(handle,"yy")<0)
{Print("error writing file");}
else
{Print("filewrite time successful @ ");}
FileClose(handle);
return(0);
}
//+----------
I expect it to write ""yy" into a file |expertsfilesmyfile.csv and thought EA runs (icon smiles), I don't have any output, even a file is not created inside expertfile directory.
Could anyone comment on what I miss here?
Your help would be much appreciated indeed!
Thank you!