Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Quad, aliswee), 835 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
AssetVars in Asset Lists #470944
02/13/18 20:07
02/13/18 20:07
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline OP
User
Sphin  Offline OP
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
From the manual AssetVars can be entered in the asset list behind the Symbol column but how to access them? Let me say an asset list looks like:
Code:
..., Commission, Symbol, TOCom
..., 0, BTC/USD, 0.0026


Do I find the value 0.0026 automatically in AssetVar[0] independent from the column's name "TOCom" (so it's better not to use AssetVar[0] otherwise in the script) or is there another way?

Thanks, Sphin

Re: AssetVars in Asset Lists [Re: Sphin] #470945
02/14/18 02:17
02/14/18 02:17
Joined: Sep 2017
Posts: 235
H
Hredot Offline
Member
Hredot  Offline
Member
H

Joined: Sep 2017
Posts: 235
Hi Sphin,

Once you call

asset(Assets[i]);

where i=0,1,2,3,... labels the assets in the AssetList.csv that you loaded, AssetVar[0] will refer to your TOCom value in the i-th row.
Yes, the row with the names does not interfere with the values. The first row (i==0) refers to the first actual asset row in your list.

Last edited by Hredot; 02/14/18 02:20.
Re: AssetVars in Asset Lists [Re: Hredot] #471034
02/16/18 17:09
02/16/18 17:09
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline OP
User
Sphin  Offline OP
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
Thanks. You mean if I call asset("BTCUSD") than AssetVar[0] has the value from the column TOCom of the row beginning with "BTCUSD" from the loaded asset list? Then I understood. laugh

Re: AssetVars in Asset Lists [Re: Sphin] #471036
02/16/18 17:16
02/16/18 17:16
Joined: Sep 2017
Posts: 235
H
Hredot Offline
Member
Hredot  Offline
Member
H

Joined: Sep 2017
Posts: 235
Yep, exactly!
At least, that is how it worked in the DualMomentum code I played around with.
I don't know if you actually want to hard code "BTCUSD" string or similar though... Code might be more powerful if you access the different assets by using "Assets[i]". Then you can switch out the asset list and test the system on different ones without changing any lines in the code. laugh Like, if tomorrow you decide to trade a different crypto than BTC for example.

Last edited by Hredot; 02/16/18 17:20.
Re: AssetVars in Asset Lists [Re: Hredot] #471055
02/17/18 18:13
02/17/18 18:13
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline OP
User
Sphin  Offline OP
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
This I think about as a maybe last step of optimizing in a completed code. But during development I like more using names of assets because pointing at them through an array means to add a potential point of failure in - and I know myself - choosing the wrong one and later wondering about issues.

Re: AssetVars in Asset Lists [Re: Sphin] #471061
02/18/18 01:50
02/18/18 01:50
Joined: Sep 2017
Posts: 235
H
Hredot Offline
Member
Hredot  Offline
Member
H

Joined: Sep 2017
Posts: 235
I see, yeah, makes sense!


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1