Gamestudio Links
Zorro Links
Newest Posts
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (EternallyCurious, TipmyPip, Quad, AndrewAMD), 904 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Error connecting Zorro and R (R Bridge) #459534
05/24/16 18:33
05/24/16 18:33
Joined: May 2016
Posts: 5
Madrid
E
ealvarpe Offline OP
Newbie
ealvarpe  Offline OP
Newbie
E

Joined: May 2016
Posts: 5
Madrid
I´m implementing an strategy that calls R through the Bridge on INITRUN, and then every new bar.
The problem is that it correctly calls and works on the INITRUN, but not after this. From the first bar, it gives me an error and abort.

The error in the zorro´s window is:

MytestR compiling.................
print(rout)

[1] 0 10 20 30 40
0 10 20 30 40
Test: MytestR EUR/USD 2014..2015
R error -
Error: cannot find the function "neural.init"

Execution interrumpted

Error - R session aborted!
Quit


Below is the code:

#include <r.h>

bool callRFunction() {
var vecIn[5],vecOut[5];
int i;
for(i=0; i<5; i++)
vecIn[i] = i;

Rset("rin",vecIn,5); // set up a vector
Rx("rout <- rin * 10"); // perform some arithmetics
Rx("print(rout)",3); // print rout to the Zorro window
Rv("rout",vecOut,5); // read it back

if(!Rrun()) {

printf("Error - R session aborted!");
return false;
}
else
for(i=0; i<5; i++)
printf("%.0f ",vecOut[i]);


return true;
}


void run()
{
BarPeriod = 60;
StartDate = 20140101;
EndDate = 20150101;

if(is(INITRUN)) {

Rstart("",2);
var vecIn[5],vecOut[5];
int i;
for(i=0; i<5; i++)
vecIn[i] = i;

Rset("rin",vecIn,5); // set up a vector
Rx("rout <- rin * 10"); // perform some arithmetics
Rx("print(rout)",3); // print rout to the Zorro window
Rv("rout",vecOut,5); // read it back

if(!Rrun())
printf("Error - R session aborted!");
else
for(i=0; i<5; i++)
printf("%.0f ",vecOut[i]);
}
else
callRFunction();
}

Re: Error connecting Zorro and R (R Bridge) [Re: ealvarpe] #459545
05/25/16 00:37
05/25/16 00:37
Joined: Apr 2014
Posts: 482
Sydney, Australia
B
boatman Offline
Senior Member
boatman  Offline
Senior Member
B

Joined: Apr 2014
Posts: 482
Sydney, Australia
I might be missing something, but how did you get that error relating to neural.init when I don't see that function called anywhere in the script you posted?

Re: Error connecting Zorro and R (R Bridge) [Re: boatman] #459548
05/25/16 06:35
05/25/16 06:35
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
That error was on our side. Edit r.h and comment out the "neural" function. It's listed in the bug list under "What's New".


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1