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
1 registered members (degenerate_762), 1,098 guests, and 2 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
dataParse - format string #477264
06/07/19 18:32
06/07/19 18:32
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
Hi,

I have data in the csv:

1551356100;rsi_14;7;0;rsi_7;0;9;willr_27;0;9;willr_60;8;0;99.25;99.01
1551357000;rsi_14;6;9;rsi_7;0;9;willr_27;0;9;willr_60;8;0;99.34;99.11
1551357900;rsi_14;5;9;rsi_7;0;5;willr_27;0;9;willr_60;8;0;98.98;97.78

and format string:
string Format = "%t;;i1;i2;;i3;i4;;i5;i6;;i7;i8;f1;f2";

with test:
Code:
for (Row=0;Row<6;Row++){
   printf("n  %s", strdate("%Y-%m-%d %H:%M", dataVar(nHandle,Row,0)));
   for (i=1;i<10;i++)
      printf(" %d",dataInt(nHandle,Row,i));
    
}



2019-02-28 12:15 1120305152 1120273695 0 9 0 9 8 0 0
2019-02-28 12:30 1120316948 1120286802 0 9 0 9 8 0 0
2019-02-28 12:45 1120269763 1120112476 0 5 0 9 8 0 0
2019-02-28 13:00 1120288113 1120229130 9 4 0 9 9 0 0
2019-02-28 13:15 1120260588 1120105923 9 3 0 9 9 0 0
2019-02-28 13:30 1120223887 1119966986 9 2 3 9 9 0 0

first 2 integer (red) are missing in the dataset. Know anybody, where I have bug?

Thanks Milan

Re: dataParse - format string [Re: Grat] #477268
06/08/19 16:54
06/08/19 16:54
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
f1, f2 is overwriting i1,i2

Re: dataParse - format string [Re: Spirit] #477272
06/09/19 06:09
06/09/19 06:09
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
No,

dataVar(nHandle,Row,1);
dataVar(nHandle,Row,2);

return correct value.

I found the solution:

[code]

string Format = "+%t;sss;i;i;sss;i;i;ss;i;i;ss;i;i;f1;f2";
int Records = dataParse(nHandle,Format,InName);

...
...

#define WIF_MAX 3
#define WIF_MIN 4
#define WIS_MAX 5
#define WIS_MIN 6

#define RSIF_MAX 7
#define RSIF_MIN 8
#define RSIS_MAX 9
#define RSIS_MIN 10

var _RSIF_MAX = (float)dataInt(nHandle,id,RSIF_MAX);
var _RSIF_MIN = (float)dataInt(nHandle,id,RSIF_MIN);
var _RSIS_MAX = (float)dataInt(nHandle,id,RSIS_MAX);
var _RSIS_MIN = (float)dataInt(nHandle,id,RSIS_MIN);
var _WIF_MAX = (float)dataInt(nHandle,id,WIF_MAX);
var _WIF_MIN = (float)dataInt(nHandle,id,WIF_MIN);
var _WIS_MAX = (float)dataInt(nHandle,id,WIS_MAX);
var _WIS_MIN = (float)dataInt(nHandle,id,WIS_MIN);

..
..
[code]

this work a correct.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1