Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, SBGuy), 987 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Beginning with R: MySignals.r #461343
08/02/16 12:48
08/02/16 12:48
Joined: Mar 2015
Posts: 336
Rogaland
N
nanotir Offline OP
Senior Member
nanotir  Offline OP
Senior Member
N

Joined: Mar 2015
Posts: 336
Rogaland
Hi

In the example of the R tutorial there are this two lines of code
Code:
Rstart("MySignals.r",1);
// load all required R objects from a file in the Zorro Data folder 
    Rx(strf("load('%sData/MyObjects.bin')",slash(ZorroFolder)));



How do those files look like?


Last edited by Nanitek; 08/03/16 11:21.
Re: Beginning with R: MySignals.r [Re: nanotir] #461378
08/03/16 12:42
08/03/16 12:42
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
MySignals.r is supposed to be a R script that does something. And MyObjects.bin is a R object file generated by "save" that contains something.

Re: Beginning with R: MySignals.r [Re: jcl] #461387
08/03/16 14:41
08/03/16 14:41
Joined: Mar 2015
Posts: 336
Rogaland
N
nanotir Offline OP
Senior Member
nanotir  Offline OP
Senior Member
N

Joined: Mar 2015
Posts: 336
Rogaland
Yes so far I get it. .r R script.

My doubt is about how it is its struct so that the functions called by zorro actually work.

.bin is created by itself then? or what should be saved over there?

Re: Beginning with R: MySignals.r [Re: nanotir] #461415
08/04/16 13:57
08/04/16 13:57
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
"save" is a R function that stores R objects in a file. The file names above are just place holders for your R script that might contain functions that process your signals in some way. They have no deeper meaning.

Re: Beginning with R: MySignals.r [Re: jcl] #461421
08/04/16 16:54
08/04/16 16:54
Joined: Mar 2015
Posts: 336
Rogaland
N
nanotir Offline OP
Senior Member
nanotir  Offline OP
Senior Member
N

Joined: Mar 2015
Posts: 336
Rogaland
So just for low code level users.

There is r file named F.r and inside it there is just a function named F()
and then I just execute Rstart("F.r",1); and after I type on zorro the line var P = Rd("F()"); and it saves the result of F over P right?

Re: Beginning with R: MySignals.r [Re: nanotir] #461440
08/05/16 10:44
08/05/16 10:44
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Yes, exactly, given that F() returns a scalar.

Re: Beginning with R: MySignals.r [Re: jcl] #461441
08/05/16 11:38
08/05/16 11:38
Joined: Mar 2015
Posts: 336
Rogaland
N
nanotir Offline OP
Senior Member
nanotir  Offline OP
Senior Member
N

Joined: Mar 2015
Posts: 336
Rogaland
Ok thanks.
It seems a bit magical, I can say for another low level coders but in my case it does. Thats why I wasnt unsure if this is just that and it will work.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1