does tester allow read/write text to file?

 

I made a simple script to write high/low open/close candle values in a text file.. It doesn't work.. tester doesn't allow read/write to file ea's right? Someone please confirm :)


Have a great weekend!!

 
It allows. Both in testing and optimization. You must have a problem with your code.
 

Default location for Strategy Tester to write to is tester/files.

Default location for EA to write to is experts/files.

Have you looked in the right place?


CB

 
cloudbreaker:

Default location for Strategy Tester to write to is tester/files.

Default location for EA to write to is experts/files.

Have you looked in the right place?


CB

Thanks Guys!


I was looking in the wrong place :) Followup question.. Everytime a Filewrite command sends something to write, it places the text entires on the same line, thus overwriting the previous data that was in there.. how do I fix that? Here's the simple EA I'm studying right now. :)



extern string Filename = "DataDump.csv";

void start()
{
Comment("Text ",Read());
Write();
}

//+------------------------------------------------------------------+
//| Write |
//+------------------------------------------------------------------+
void Write()
{

int handle;
datetime orderOpen=OrderOpenTime();
handle=FileOpen(Filename, FILE_CSV|FILE_WRITE, ',');
if(handle>0)
{
FileSeek(handle,0,SEEK_END);
FileWrite(handle, Bid);
FileClose(handle);
}

}
//+------------------------------------------------------------------+
//| Read |
//+------------------------------------------------------------------+
double Read()
{

int handle;
double Adjustment;
handle=FileOpen(Filename, FILE_CSV, ',');
if(handle>0)
{
Adjustment = (FileReadNumber(handle));
FileClose(handle);
}
return(Adjustment);
}

 

Replace:

handle=FileOpen(Filename, FILE_CSV|FILE_WRITE, ',');


with:

handle=FileOpen(Filename, FILE_CSV|FILE_READ|FILE_WRITE, ',');


CB

Reason: