Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 559 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
communication between Zorro and R #477697
07/22/19 07:41
07/22/19 07:41
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
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

Re: communication between Zorro and R [Re: Grat] #477706
07/23/19 07:25
07/23/19 07:25
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
name is the string name and s is the content you want to send.

Rset("MyString","Test");

Re: communication between Zorro and R [Re: Grat] #477707
07/23/19 07:45
07/23/19 07:45
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
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++;
      }


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1