I had the same need: running backtest between several "From-To" Ranges.
Following Mastermind suggestions, althought not totally, I carried out the following script:
From1="01/01/2005";
To1="31/12/2005";
DateFrom1=(StrToNum(StrRight(From1, 4))-1900)*10000+ StrToNum(StrMid(From1, 3, 2))*100 + StrToNum(StrLeft(From1, 2));
DateTo1=(StrToNum(StrRight(To1, 4))-1900)*10000+ StrToNum(StrMid(To1, 3, 2))*100 + StrToNum(StrLeft(To1, 2));
InRange1= DateNum() >= DateFrom1 AND DateNum() <= DateTo1;
From2="01/01/2013";
To2="12/12/2013";
DateFrom2=(StrToNum(StrRight(From2, 4))-1900)*10000+ StrToNum(StrMid(From2, 3, 2))*100 + StrToNum(StrLeft(From2, 2));
DateTo2=(StrToNum(StrRight(To2, 4))-1900)*10000+ StrToNum(StrMid(To2, 3, 2))*100 + StrToNum(StrLeft(To2, 2));
InRange2= DateNum() >= DateFrom2 AND DateNum() <= DateTo2;
InRange= InRange1 OR InRange2;
You have to change the 2 From-To Range periods as you like and then add InRange condition to your buy conditions:
buy= InRange and yourcondition1 and your condition2 and ...
of course if you need a third, fourth ... 'From-to' range period, you have just to copy the following script several time replacing "2" with 3 ... 4 ...
From2="01/01/2013";
To2="12/12/2013";
DateFrom2=(StrToNum(StrRight(From2, 4))-1900)*10000+ StrToNum(StrMid(From2, 3, 2))*100 + StrToNum(StrLeft(From2, 2));
DateTo2=(StrToNum(StrRight(To2, 4))-1900)*10000+ StrToNum(StrMid(To2, 3, 2))*100 + StrToNum(StrLeft(To2, 2));
InRange2= DateNum() >= DateFrom2 AND DateNum() <= DateTo2;
and dont forget to add inrange3 ... inrange4 to the last instruction
InRange= InRange1 OR InRange2 or Inrange3 ...;
Hope it helps