I'm testing a version of the low pass strategy from Workshop 4 and noticed that I get entirely different results when I use TimeFrame=1 / BarPeriod=240 vs. TimeFrame=4 / BarPeriod=60.
Here are the results for TimeFrame=4 / BarPeriod=60:
Run Test Script..
Walk-Forward Test: Test Script EUR/USD 2002..2013
Read Test Script_1.par Test Script_2.par Test Script_3.par Test Script_4.par
Profit -35$ MI -1$ DD 176$ Capital 147$
Trades 15 Win 47% Avg -30.6p Bars 251
AR -5% PF 0.81 SR -0.12 UI 81.5% Error 117%
And here are the results for TimeFrame=1 / BarPeriod=240:
Run Test Script..
Walk-Forward Test: Test Script EUR/USD 2002..2013
Read Test Script_1.par Test Script_2.par Test Script_3.par Test Script_4.par
Profit 115$ MI 2$ DD 136$ Capital 122$
Trades 25 Win 32% Avg +60.3p Bars 142
AR 22% PF 1.47 SR 0.25 UI 27.2% Error 98%
Time 00:01:48
As you can see, a considerable difference. Why would this be?
I trained each version separately, and the only change in code is the TimeFrame/BarPeriod. Am I missing something?
Here is the code for the strategy:
function tradeTrend1()
{
TimeFrame = 4;
vars Price = series(price());
vars Trend = series(LowPass(Price,optimize(1000,500,1500)));
vars Signals = series(0);
Stop = 10*ATR(20);
TakeProfit = 10*ATR(20);
Entry = -20*PIP;
if(valley(Trend)) {
Signals[0] = 1;
if(Sum(Signals+1,4) == 0)
enterLong();
} else if(peak(Trend)) {
Signals[0] = 1;
if(Sum(Signals+1,4) == 0)
enterShort();
}
}
function run()
{
set(PARAMETERS+TICKS+TESTNOW);
set(LOGFILE);
BarPeriod = 60;
LookBack = 500;
StartDate = 2002;
NumWFOCycles = 5;
if(ReTrain) {
UpdateDays = -1;
SelectWFO = -1;
}
// portfolio loop
while(asset(loop("EUR/USD")))
while(algo(loop("TRND")))
{
if(strstr(Algo,"TRND") and strstr(Asset,"EUR/USD"))
tradeTrend1();
}
PlotWidth = 600;
PlotHeight1 = 300;
}