function checkEntry()
{
int i;
// check for five negative candles
for (i = 5; i >= 0; i--)
{
if (i == 0)
if (priceClose(i) - priceOpen(i) > 0)
if (priceOpen(1) > priceClose(0))
{
Entry = priceOpen(1);
Stop = priceOpen(0);
TakeProfit = priceOpen(5);
enterLong();
}
if (priceClose(i) - priceOpen(i) >= 0)
break;
}
// check for positive candles
for (i = 5; i >= 0; i--)
{
if (i == 0)
if (priceClose(i) - priceOpen(i) < 0)
if (priceOpen(1) < priceClose(0))
{
Entry = priceOpen(1);
Stop = priceOpen(0);
TakeProfit = priceOpen(5);
enterShort();
}
if (priceClose(i) - priceOpen(i) <= 0)
break;
}
}

function run()
{
set(LOGFILE);
set(HEDGING);
// var *Trend = series(EMA(Price,250));
TimeWait = 5;

checkEntry();
// zoom in a certain date
StartDate = 20081025;
// NumDays = 10;
// plot("Trend",*Trend,0,RED);

PlotWidth = 800;
PlotHeight1 = 320;
}

That's my first result. Though I get a few "invalid Profit Target errors on EUR/USD, so there is probably still something wrong.

It does not seem to have an edge at first glance.