ffsss wrote: Thu Sep 02, 2021 7:16 pm
Is it possible to export a .csv file after a backtest? For example, if I create a counter for the number of operations that adds +1 each time an order is opened, at the end of the backtest I would create a .csv that would contain the value of the total number of open operations in that backtest.
Hi ffsss,
That EA code below does similar. To check csv after test, go to \tester\files folder.
Code: Select all
double count13 = 0;
double count15 = 0;
void OnTick()
{
if(Hour() == 13) count13 += 1;
if(Hour() == 15) count15 += 1;
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
double OnTester()
{
int handle;
handle=FileOpen("countTest", FILE_CSV|FILE_WRITE, '\t');
if(handle>0)
{
FileWrite(handle, "Count13 " + count13, "Count15 " + count15);
FileClose(handle);
}
return(0);
}
//+------------------------------------------------------------------+