function run()
{
StartDate = 2010;
EndDate = 2020;
BarMode = BR_FLAT;
set(PARAMETERS+TESTNOW);
BarPeriod=60;
NumWFOCycles=3;
LookBack = 500;
Capital = 1000000;
while(asset(loop("EUR/USD","GBP/USD","USD/CAD","AUD/USD")))
{
vars Price = series(price());
int MMP = optimize(300,200,400,40);
vars MM1 = series(LowPass(Price, MMP));
int MMIP = 300;
vars MMI_Raw = series(MMI(Price,MMIP));
vars MSmooth = series(LowPass(MMI_Raw,300));
if(
NumOpenLong < 1
and valley(MM1)
and falling(MSmooth)
) enterLong();
if(
NumOpenShort < 1
and peak(MM1)
and falling(MSmooth)
) enterShort();
Stop = ATR(25)*3;
Trail = ATR(25)*3;
}
}