Hi, I am trying to use H2O prediction with the DeepLearn.c script based on a signal array. The train function crashes in the Train Short function and I could not find any reason and looking for your support.
The DeepLearnH2o.r script works with the regular DeepLearn.c script if I do not use an array. The DeepLearn.c script with the array works with the DeepLearn.r. But DeepLearn.c with the array does not work with H2O.r script. Any help is appreciated:

DeepLearn with array:

// Deep Learning Test ///////////////////////////////////////////

//#define DO_SIGNALS // generate sample set in Train mode
//#define DEEPNET
#define H2O
//#define MXNET
//#define KERAS

///////////////////////////////////////////////////////////////////////
#include <r.h>

var change(int n)
{
return scale((priceClose(0) - priceClose(n))/priceClose(0),100)/100;
}

var range(int n)
{
return scale((HH(n) - LL(n))/priceClose(0),100)/100;
}

///////////////////////////////////////////////////////////////////////

function run()
{
NumCores = -1;
#ifdef H2O
Script = "DeepLearnH2O"; //DeepLearnH2O
NumCores = 2; // H2O is single instance only
#endif
#ifdef MXNET
Script = "DeepLearnMX";
#endif
#ifdef KERAS
Script = "DeepLearnKeras";
#endif
StartDate = 20170101;
BarPeriod = 60; // 1 hour
LookBack = 100;
Verbose = 3|DIAG;

WFOPeriod = 252*24; // 1 year
DataSplit = 90;

assetList("AssetsFXCM");
asset("GER30");
set(RULES);
Spread = RollLong = RollShort = Commission = Slippage = 0;
LifeTime = 3;
if(Train) Hedge = 2;
var Threshold = 0.5;

var vLong,vShort;

var exportarr[8];
exportarr[0]= change(1);
exportarr[1]= change(2);
exportarr[2]= change(3);
exportarr[3]= change(4);
exportarr[4]= range(1);
exportarr[5]= range(2);
exportarr[6]= range(3);
exportarr[7]= range(4);
///////////////////////////////////////////////////////////
#ifdef DO_SIGNALS
SelectWFO = -1; // use the last WFO cycle for calibrating the neural net
if((vLong = adviseLong(SIGNALS+BALANCED,0,
#else
set(LOGFILE|PLOTNOW);
if((vLong = adviseLong(NEURAL+BALANCED,0,
#endif
exportarr, 8)) > Threshold)
enterLong();
#ifndef DO_SIGNALS
if((vShort = adviseShort()) > Threshold)
enterShort();
#endif
PlotWidth = 800;
PlotHeight1 = 340;
}


DeepLearnH2O.r

library('h2o', quietly = T) # also needs the Java JDK
library('caret', quietly = T)
library('e1071', quietly = T)

neural.train = function(model,XY)
{
XY <- as.h2o(XY)

Models[[model]] <<- h2o.deeplearning(-ncol(XY),ncol(XY),XY,
hidden = c(30,30,30),
seed = 365)
}

# sends anything to the cluster. Fast for batches, really slow for single predictions.
neural.predict = function(model,X)
{
if(is.vector(X))
X <- as.h2o(as.data.frame(t(X)))
else
X <- as.h2o(X)
Y <- h2o.predict(Models[[model]],X)
return(as.vector(Y))
}

neural.load = function(name)
{
load(name,envir=.GlobalEnv)
}

neural.save = function(name)
{
save(Models,file=name)
}

# won't run parallel. Any new client connects happily to the running cluster.
neural.init = function()
{
h2o.init()
Models <<- vector("list")
}

neural.test = function()
{
neural.init()
# read the training data frame generated with the SIGNALS method
XY <<- read.csv('MyZorroPath/Data/DeepLearnH2O.csv',header = F)
splits <- nrow(XY)*0.8
XY.tr <<- head(XY,splits)
XY.ts <<- tail(XY,-splits)
neural.train(2,XY.tr)
X <<- XY.ts[,-ncol(XY.ts)]
Y <<- XY.ts[,ncol(XY.ts)]
Y.ob <<- ifelse(Y > 0,1,0)
Y <<- neural.predict(2,X)
Y.pr <<- ifelse(Y > 0,1,0)
confusionMatrix(as_factor(Y.pr),as_factor(Y.ob))
}