Gamestudio Links
Zorro Links
Newest Posts
Zorro version 3.0 prerelease!
by Grant. 02/24/26 22:21
WFO Training with parallel cores Zorro64
by Martin_HH. 02/24/26 19:51
ZorroGPT
by TipmyPip. 02/23/26 21:52
Camera always moves upwards?
by clonman. 02/21/26 09:29
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
5 registered members (TipmyPip, clint000, Grant, chsmac85, Martin_HH), 5,858 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Function static variables by Asset and/or Algo? #452097
06/02/15 15:18
06/02/15 15:18
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline OP
Serious User
DdlV  Offline OP
Serious User
D

Joined: Jun 2013
Posts: 1,609
Hi jcl.

I'd like to code a function that would internally store data from call to call, and use this function for different Assets and possibly Algos.

Is there a simple or recommended way to establish separate static variable spaces by Asset and/or Algo so the calls won't clobber each other's saved data?

Thanks.

Re: Function static variables by Asset and/or Algo? [Re: DdlV] #452103
06/02/15 16:20
06/02/15 16:20
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline
User
GPEngine  Offline
User
G

Joined: Sep 2013
Posts: 504
California
Just making sure : Have you seen http://zorro-trader.com/manual/en/algovar.htm

Re: Function static variables by Asset and/or Algo? [Re: GPEngine] #452110
06/02/15 17:18
06/02/15 17:18
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline OP
Serious User
DdlV  Offline OP
Serious User
D

Joined: Jun 2013
Posts: 1,609
Thanks GPEngine. Yes, I've seen that, and will use it if need be. Question wasn't really specific enough. Looking toward a number of functions that could be used across multiple strategies, I was hoping for something else that wouldn't chew up algovars - both from reducing the remaining # available to each strategy as well as avoiding the bookkeeping hassle of recording which algovars were used by which functions...

Looking even further down the road, if I manage to come up with something useful to the community to contribute laugh , it probably shouldn't use algovars either...

There seems to be the possibility of using series. I don't see this included in the documentation of either asset() or algo(), but in initial testing series also seem to be stored separately by Asset & Algo. jcl, can you confirm?

Thanks.

Re: Function static variables by Asset and/or Algo? [Re: DdlV] #452116
06/02/15 17:53
06/02/15 17:53
Joined: Jul 2000
Posts: 28,075
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,075
Frankfurt
Series are not stored separately. But when you create series inside an asset/algo loop, you get them individually per loop and thus automatically per asset/algo. So you can indeed use series for your purpose.

Re: Function static variables by Asset and/or Algo? [Re: jcl] #452121
06/02/15 18:32
06/02/15 18:32
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline OP
Serious User
DdlV  Offline OP
Serious User
D

Joined: Jun 2013
Posts: 1,609
Thanks!


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