Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (vicknick, howardR, sleakz), 674 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
AssetFloat not work? #483182
05/08/21 09:41
05/08/21 09:41
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
Be carefull, with the version Zorro not work
Zorro S 2.37.4b
(c) oP group Germany 2021


Code
function run()
{
    asset("EUR/USD");
    AssetFloat[0]=1234.56;
    printf("\n%s = %f",Asset,AssetFloat[0]);
    quit("ok!");
}


have output:
Code

testIN compiling...........
EUR/USD = 0.000000
Test: testIN EUR/USD 2016..2021
Assets Assets4

ok!


Re: AssetFloat not work? [Re: Grat] #483183
05/08/21 09:47
05/08/21 09:47
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
Other problem - must be know

Code

function run()
{

    asset("EUR/USD");
    AssetVar[0]=33.99;
    printf("\n%s = %f",Asset,AssetVar[0]);
    AssetFloat[0]=1234.56;
    printf("\n%s = %f",Asset,AssetVar[0]);
    quit("ok!");
}



have this output:
Code

testIN compiling...........
EUR/USD = 33.990002
EUR/USD = 33.989998
Test: testIN EUR/USD 2016..2021
Assets Assets4

ok!



This is correct - from manual:
32 general purpose int or float variables for internally storing integers or floats specific to the current asset. They are shared with AssetVar/AssetStr at twice the index, i.e. AssetVar[N] is shared with AssetInt[2*N] and AssetInt[2*N+1]. They cannot be read from the asset list. AssetInt can also be used to store asset-specific series or pointers for using them in a tmf or tick function.

Last edited by Grat; 05/08/21 09:53.
Re: AssetFloat not work? [Re: Grat] #483186
05/08/21 13:51
05/08/21 13:51
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
You need to cast float to var in order for printf to work.

Yes, var(double) is double the width of float. This has implications for pointer arithmetic / array positions.

You can read var and strings up to seven characters in length in your asset list for AssetVar and AssetStr, respectively.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1