I am trying to switch variable sets by date (see code below) during a backtest.
The problem is the backtester seems to only be using the variables from the
last date set in the AA From/TO box. I'm pretty sure I've got the logic right
but I am having difficulty with the syntax of how to do this. Anyone got any
ideas?
Basically, the goal is to run a OOS walk-forward tests using pre-calculated IS
variables as a continuous sequence that does not exit positions at date
transitions and would more closely mirror how a system was traded in real-time.
//////////////////// VARIABLES ////////////////////
s1999 = "1500,10,99,2,3,3";
s2000 = "1500,10,99,2,3,3";
s2001 = "100,10,50,2,3,3";
s2002 = "1500,10,99,2,3,3";
s2003 = "1500,10,99,2,3,3";
s2004 = "1500,10,99,2,3,3";
s2005 = "1500,10,99,2,3,3";
s2006 = "1500,10,99,2,3,3";
s2007 = "1500,10,99,2,3,3";
s2009 = "1500,10,99,2,3,3";
s2010 = "20,10,50,2,3,3";
//////////////////// DATERANGE ////////////////////
sYear = VarGetText("s"+Year());
MinSlope = StrToNum(StrExtract(sYear,0));
EntryThreshold = StrToNum(StrExtract(sYear,1));
ExitThreshold = StrToNum(StrExtract(sYear,2));
ATRmult = StrToNum(StrExtract(sYear,3));
MOP = StrToNum(StrExtract(sYear,4));
PercentRisk = StrToNum(StrExtract(sYear,5));