Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 03/08/26 18:50
zorro with ccxt?
by opm. 03/03/26 03:17
WFO Training with parallel cores Zorro64
by Martin_HH. 02/26/26 16:03
Zorro version 3.0 prerelease!
by TipmyPip. 02/25/26 16:38
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (clint000, TipmyPip, AndrewAMD), 15,132 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
the1, alx, ApprenticeInMuc, PatrickH90, USER0328
19200 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
how to save AlgoVars in Dummy Asset #477202
05/30/19 15:00
05/30/19 15:00
Joined: Nov 2018
Posts: 55
G
gamadeus Offline OP
Junior Member
gamadeus  Offline OP
Junior Member
G

Joined: Nov 2018
Posts: 55
I would like to save and load the some AlgoVars for a DUMMY asset, however I find that Zorro is not able to do that (or I made an error somewhere). Take this example script below:

function run()
{
if(is(INITRUN)) assetAdd("DUMMY");
if(Bar >= 1) {
algo("TEST");
asset("#DUMMY");

AlgoVar[0] = 123;
SaveMode = SV_ALGOVARS;
saveStatus("DataTest.trd");
quit();

AlgoVar[0] = 456;
printf("n %.0f",AlgoVar[0]);
loadStatus("DataTest.trd");
printf("n %.0f",AlgoVar[0]);
quit();
}
}


I noticed that this has to do with the `#` for the DUMMY Asset, which I need because I do not want to load any data, not even 1s for it.
But apparently, since the script prints 456 twice, the hash prevents not just loading of price data but loading of any Algovars into that Asset from the trd file.

And is there any way to circumvent this with a blank asset?

Last edited by gamadeus; 05/30/19 17:12.
Re: how to save AlgoVars in Dummy Asset [Re: gamadeus] #477206
05/31/19 12:12
05/31/19 12:12
Joined: Jul 2000
Posts: 28,083
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,083
Frankfurt
The algovars are specific to existing assets or algos. So it makes no sense to use a dummy asset here. If you only want to save some variables, use putvar and getvar. They are asset independent.

Re: how to save AlgoVars in Dummy Asset [Re: jcl] #477213
05/31/19 17:07
05/31/19 17:07
Joined: Nov 2018
Posts: 55
G
gamadeus Offline OP
Junior Member
gamadeus  Offline OP
Junior Member
G

Joined: Nov 2018
Posts: 55
you are right, jcl. I realized that myself when thinking more on the problem. thanks for your advice!


Moderated by  Petra 

Gamestudio download | 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