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), 600 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
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: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
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 | 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