You should set Stop & TakeProfit before entering trade(s), not after, I believe. Also I would not create 2 series of priceClose() data, but only one. Finally, I'd name the series a little better, so it's easier to parse the algo for humans. Comes handy later when you have to debug some issue and your eyes hurt. So, here's how I'd do it:

Code:
function run()
{
	BarPeriod = 1440;

	vars Close = series(priceClose());
	vars Price = series(price());

	Stop = 30 * PIP;
	TakeProfit = 500 * PIP;

	if (Close[2] < Close[1] && Price[0] < Close[2])
		enterLong();

	if (Close[2] > Close[1] && Price[0] > Close[2])
		enterShort();
}



Of course, I can't verify if your strategy does what you want it to do. You could try optimizing it now (Stop & TakeProfit, probably). One problem I see is that it can be dormant for a very long periods of time (month or maybe even two without a single trade), so it would not be easy to trade it for real. But, it's a good start for learning Lite-C. wink