communication between Zorro and R

Posted By: Grat

communication between Zorro and R - 07/22/19 07:41

Hi,

in the sample (DeepLearn.c) is this code:

Code
#ifdef KERAS
	if(Init) printf("\nR and Keras required"); 
	Script = "DeepLearnKeras";
#endif	


I cannot find in the manual, how to send message between script in Zorro and R in this case. In Zorro script no exist "RStart".

How to call the Rset(string name, string s) ?

Thanks
Posted By: jcl

Re: communication between Zorro and R - 07/23/19 07:25

name is the string name and s is the content you want to send.

Rset("MyString","Test");
Posted By: Grat

Re: communication between Zorro and R - 07/23/19 07:45

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++;
      }
© 2024 lite-C Forums