function run()
{
BarPeriod = 30;
FrameOffset = timeOffset(ET,0,0,0); // calculate daily bars with ET close
TimeFrame = 48; // Calculate daily bars
vars dailycl = series(priceClose());
vars sma10 = series(SMA(dailycl,10));
vars sma40 = series(SMA(dailycl,40));
var longentry = HH(10) + (1*PIP);
var shortentry = LL(10) - (1*PIP);
TimeFrame = 1; // back to 30 min bars
TimeWait = 15; // Remove pending orders at end of market day
if (ldow(ET) == FRIDAY)
{
if (sma10[0] > sma40[0])
{
if ((lhour(ET,0) == 9) and (minute(0) == 30))
{
enterLong(1,longentry);
}
}
if (sma10[0] < sma40[0])
{
if ((lhour(ET,0) == 9) and (minute(0) == 30))
{
enterShort(1,shortentry);
}
}
}
if (ldow(ET) == MONDAY)
{
if ((lhour(ET,0) == 9) and (minute(0) == 30))
{
exitLong();
exitShort();
}
}
PlotWidth = 4000;
PlotHeight1 = 700;
}