How to automate testing a strategy on multiple symbols - time frame?

I would like to automate the optimization or test process for multiple symbols in different time frames.
Let's say I write a new strategy and I want to test it extensively, this means I want to:

  • Optimize or Test it on 20 different symbols in 3 different time frames.
  • write the results to CSV file for each symbol/TF combination

What's the best way to do this?

I looked at the batch, I am not sure if it fits . I've some question,
let's say I create 3 project for 15, 30 and 45 minutes TF

  • Do I need to manually update each project with the new strategy when I want to test it?
  • Can I put variables in the output file name, like datetime Output_{datetime}.csv ?

EnableTextOutput (False);
EnableScript ("VBScript");

//Initialize all variables to zero
CPAUDJPY = 0;
NTSCPAUDJPY = 0;
STNCPAUDJPY = 0;

TFCAUDJPY1800 = 0;
MAAUDJPY1800 = 0;
NTSMAAUDJPY1800 = 0;
STNMAAUDJPY1800 = 0;

TFCAUDJPY3600 = 0;
MAAUDJPY3600 = 0;
NTSMAAUDJPY3600 = 0;
STNMAAUDJPY3600 = 0;

DT1 = Date();
printf ( "Date AND TIME " +DT1);
printf ( " \n" );

// VBScript codes for sending data to Excel
<%
Set ObjExcel = GetObject(,"Excel.Application")
Set ObjSheet = ObjExcel.ActiveWorkbook.Worksheets(1)

Function Fire(row, column, ValueX)
ObjSheet.Cells(row, column).Value = ValueX
End function

Function PrintTime(DT1)
Set ObjSheet888 = ObjExcel.ActiveWorkbook.Worksheets(2)
ObjSheet888.Cells(8, 1).Value = DT1
End Function

%>

//later call these from any symbol/ticker sections (call from GOOG or AUD.JPY)
MYVBS = GetScriptObject();
MYVBS.PrintTime(DT1);
MYVBS.Fire(3,3,333);

//*****************************************************
SetForeign("AUD.JPY-IDEALPRO-CASH");
//*****************************************************

CPAUDJPY = C;
NTSCPAUDJPY = NumToStr(CPAUDJPY,format = 1.3 );
STNCPAUDJPY = StrToNum(NTSCPAUDJPY);
//*****************************************************
TFCAUDJPY1800 = TimeFrameCompress(Close,1800);
MAAUDJPY1800 = MA(TFCAUDJPY1800,500);
NTSMAAUDJPY1800 = NumToStr(MAAUDJPY1800, format = 1.3 );
STNMAAUDJPY1800 = StrToNum(NTSMAAUDJPY1800);

//*****************************************************
TFCAUDJPY3600 = TimeFrameCompress(Close,3600);
MAAUDJPY3600 = MA(TFCAUDJPY3600,500);
NTSMAAUDJPY3600 = NumToStr(MAAUDJPY3600, format = 1.3 );
STNMAAUDJPY3600 = StrToNum(NTSMAAUDJPY3600);
//*****************************************************
RestorePriceArrays(); // UNsetforeign before we start new SetForeign

//setforeign again for any symbols/tickers (GOOG,CSCO,MFST etc)

When posting the formula, please make sure that you use Code Tags (using </> code button) as explained here: How to use this site.

Using code button

Code tags are required so formulas can be properly displayed and copied without errors.

1 Like

Thanks I will have a try