Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, NeoDumont), 761 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Output series data to CSV - dynamic length? #484323
10/09/21 13:38
10/09/21 13:38
Joined: Sep 2021
Posts: 8
EL PASO
P
pounceyzorro Offline OP
Newbie
pounceyzorro  Offline OP
Newbie
P

Joined: Sep 2021
Posts: 8
EL PASO
Hi,

Another noobie question...

I have coded up some specific series that I'd like to export to a CSV file; would have thought it to be pretty easy,
however, am not sure I am seeing the right output length's for the calculated series; I tried NumBars; it came out 0,
then Lookback, which was 80, etc... Am looking for something like the pseudocode below; I will adapt it to write to a
file, etc. The real issue is this: what should mySeriesLength be set to? Do I have to use a different function other
than run() to accompish this? It appeared that any output printf's in run() executed BEFORE the data was loaded,
series were calculated, etc.

vars myseries1=series(<function of interest>);
vars myseries2=series(<function of interest>);
...
for(i=0; i < mySeriesLength; i++)
{
printf("%f %f", myseries1[i],myseries2[i]);
}

Please advise,
TIA for your help,
Vode Norwood

Re: Output series data to CSV - dynamic length? [Re: pounceyzorro] #484325
10/09/21 15:28
10/09/21 15:28
Joined: Oct 2021
Posts: 4
C
Chiller Offline
Guest
Chiller  Offline
Guest
C

Joined: Oct 2021
Posts: 4
run is executed on every bar.
The first too times and the last time you can detect with the flags INITRUN, FIRSTRUN and EXITRUN.
e.g. if (!is(INITRUN)) will spare the initrun.
After the function run you still have an extra function thats called evaluate (and before main) these 2 are not repeated.

Last edited by Chiller; 10/09/21 18:19.
Re: Output series data to CSV - dynamic length? [Re: pounceyzorro] #484327
10/09/21 16:22
10/09/21 16:22
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
The length of a series is given in the series call, if none is given it's the lookback period.

Re: Output series data to CSV - dynamic length? [Re: Spirit] #484330
10/10/21 00:45
10/10/21 00:45
Joined: Sep 2021
Posts: 8
EL PASO
P
pounceyzorro Offline OP
Newbie
pounceyzorro  Offline OP
Newbie
P

Joined: Sep 2021
Posts: 8
EL PASO
Quick question: so, on each invocation of run(), the series values in, say, series[0] should give the current value that was calculated, independent of how many are being stored via the lookback period default length? Am assuming that the series acts like a queue, with data shifted from [0] to [1]...up through [lookback length -1] and the new data being placed in [0].

TIA for any responses,
Vode


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1