function run() {
LookBack = 500;
StartDate = 2010;
EndDate = 2015;
asset("EUR/USD");
vars Price = series(price());
vars Trend = series(LowPass(Price,500));
// ISSUE: uncommenting the line below gives a different test result!
//vars MMI_Raw = series(MMI(Price,300));
Stop = 4*ATR(100);
if(valley(Trend))
enterLong();
else if(peak(Trend))
enterShort();
}