I really don't know what you did wrong, because I'm not getting any errors.
Side note: your code would be cleaner if you used the
loop function as follows:
function run()
{
assetList("AssetsFile.csv");
while(loop(Assets))
{
asset(Loop1);
vars Prices = series(priceClose());
DChannel(50);
vars upb = series (rRealUpperBand);
if (Prices[0] > upb[1])
enterLong();
}
}