Posted By: Dalla
adviseLong returns 0 with custom Objective - 01/11/18 09:07
Hi,
I'm trying to use a custom Objective for my advise functions, but right now my adviseLong always returns zero.
My Zorro code looks like this
If I change my code to use SIGNALS during training, and give the resulting input to my neural.predict function straight from R, the predictions are returned as expected. So I must be doing something wrong on the Zorro side.
I've trying putting enterLong() in the if(Train) block as well, but that doesn't make any difference, and I don’t think it's needed when not using trade results as the target?
Anything obviously wrong with Zorro my code?
I'm trying to use a custom Objective for my advise functions, but right now my adviseLong always returns zero.
My Zorro code looks like this
Code:
var params[10]; params[0] = cubicDev10N[0]; params[1] = deltaPVR5N[0]; params[2] = deltabWidth3N[0]; params[3] = MMIFasterN[0]; params[4] = deltaMMIFastest10N[0]; params[5] = HurstFast[0]; params[6] = HurstFaster[0]; params[7] = ibsOneN[0]; params[8] = ATRSlowN[0]; params[9] = marketVolNorm[0]; set(RULES); var myObje = ifelse(priceClose(-1) - priceClose(0) > 20,1,-1); LifeTime = 1; MaxLong = 1; if(Train) { Hedge = 2; set(PEEK); adviseLong(NEURAL+BALANCED, myObje, params,10); } if(!Train) { var LongPrediction = adviseLong(NEURAL, myObje, params,10); printf("nPred for long is %f", LongPrediction); if(LongPrediction > 0.5) { enterLong(); } }
If I change my code to use SIGNALS during training, and give the resulting input to my neural.predict function straight from R, the predictions are returned as expected. So I must be doing something wrong on the Zorro side.
I've trying putting enterLong() in the if(Train) block as well, but that doesn't make any difference, and I don’t think it's needed when not using trade results as the target?
Anything obviously wrong with Zorro my code?