like this?
Code
cFile <-""
neural.test = function() 
{
  neural.init()
  XY <<- read.csv(paste('E:\\tmp\\ZorroS\\Data\\ai_NN_EURUSD_',cFile,'_L.csv',sep=''),header = F)
  splits <- nrow(XY)*0.8
  XY.tr <<- head(XY,splits)
  XY.ts <<- tail(XY,-splits)
  neural.train(1,XY.tr)
  
  X <<- XY.ts[,-ncol(XY.ts)]
  Y <<- XY.ts[,ncol(XY.ts)]
  Y.ob <<- ifelse(Y > 0,1,0)
  Y.pr <<- neural.predict(1,X)
  confusionMatrix(as.factor(Y.pr),as.factor(Y.ob))
}


and in th script.c
Code

      while (loop(SYS_INDI)){
        algo(Loop1);
        Rset("cFile", Loop1);

        int nRow15=findRow(dDate,nL);     // find the actual value from PROD
        fillPredict(nRow15,nL);
        goAdvise(nIndex);
        nIndex+=2;
        nL++;
      }