function run()
{
set(PLOTNOW | PLOTPRICE);
BarPeriod = 1;
StartDate = 20120501;
EndDate = 20121231;
Spread = 0;
Slippage = 0;
RollLong = 0;
RollShort = 0;
Weekend = 0;
LookBack = 60;
PlotWidth = 800;
PlotHeight1 = 640;
asset("EUR/USD");
vars Price = series(priceClose());
vars Fast = series(SMA(Price, 8));
vars Slow = series(SMA(Price, 44));
static var BuyLimit, SellLimit, BuyStop, SellStop;
if (crossOver(Fast, Slow)) {
BuyStop = priceHigh() + 1 * PIP;
BuyLimit = priceHigh() + 5 * PIP;
}
if (crossUnder(Fast, Slow)) {
SellStop = priceLow() - 1 * PIP;
SellLimit = priceLow() - 5 * PIP;
}
if (!NumOpenLong && Fast[0] > Slow[0] && Price[0] < BuyLimit)
enterLong(1, BuyStop);
if (!NumOpenShort && Fast[0] < Slow[0] && Price[0] > SellLimit)
enterShort(1, SellStop);
}