@jcl, have I handled the offsets and timeframes correctly so that the daily price series are for ET market close, the SMA's thursday nights, and the hh & ll the correct 10 ET daily highs and lows? Does this now automatically handle ET daylight savings?

@DMB what instruments is this supposed to work on?
I've assumed that the open & close are US regualr sessions, cna you confirm if this is the case. It does not look profitable to me.



Code:
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;

}


Last edited by swingtraderkk; 08/14/13 12:20.