Export .csv file after backtest.

1
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.


Re: Export .csv file after backtest.

2
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);
  }
//+------------------------------------------------------------------+
These users thanked the author Csj179t for the post:
ffsss
Sincerely,
Sergei

Re: Export .csv file after backtest.

3
Csj179t wrote: Thu Sep 02, 2021 8:16 pm 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);
  }
//+------------------------------------------------------------------+
Thanks!
These users thanked the author ffsss for the post:
Csj179t


Who is online

Users browsing this forum: ASki and 7 guests