I came up with this but it doesn't appear to work which is a shame because logically in my head it looks fine.

function run()

{
BarPeriod = 1440;

var *ClosePrice = series(priceClose());
DChannel(55);

var *dcentup = series(rRealUpperBand);

var *dcentdown = series(rRealLowerBand);


DChannel(20);

var *dcexup = series(rRealUpperBand);

var *dcexdown = series(rRealLowerBand);

if(numLong = 0 && ClosePrice[0] > dcentup[0])
enterLong();
if(numShort = 0 && ClosePrice[0] < dcentdown[0])
enterShort();
if(numLong > 0 && ClosePrice[0] < dcexdown[0])
exitLong();
if(numShort > 0 && ClosePrice[0] > dcexup[0])
exitShort();
}

JCL, do you just get completely exasperated by people who can't work this stuff out even though there are a couple of lines in the manual that explain it all perfectly (to you)? :-)

I swear you could have written some of it in German and I would have had more chance of understanding it! I will get there though, I am determined to work this thing out.