Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, howardR), 1,001 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Working with series inside arrays #454853
09/25/15 15:43
09/25/15 15:43
Joined: Mar 2015
Posts: 336
Rogaland
N
nanotir Offline OP
Senior Member
nanotir  Offline OP
Senior Member
N

Joined: Mar 2015
Posts: 336
Rogaland
I have define the next array

vars Band_Array[50];
int i;
for(i=0;i<50;i++){
Band_Array[i] = series(BandPass(Price,i+10,0.5));
}

It works fine.
The problem is that I dont know how to extract any values from that array like Band_Array[0][1].
Any ideas?

Last edited by Nanitek; 09/25/15 15:44.
Re: Working with series inside arrays [Re: nanotir] #454854
09/25/15 15:47
09/25/15 15:47
Joined: Sep 2013
Posts: 64
Spain
yosoytrader Offline
Junior Member
yosoytrader  Offline
Junior Member

Joined: Sep 2013
Posts: 64
Spain
Hi Nanitek,
it's a long time that I don't code in Zorro,
but I would say

Band_Array[0] is last's bar value,
Band_Array[1] is previous bar value, .. and so on

hope it's like this


Happy trading laugh
Re: Working with series inside arrays [Re: yosoytrader] #454857
09/25/15 16:59
09/25/15 16:59
Joined: Mar 2015
Posts: 336
Rogaland
N
nanotir Offline OP
Senior Member
nanotir  Offline OP
Senior Member
N

Joined: Mar 2015
Posts: 336
Rogaland
Not really
Band_Array[1] is the series with i=1 then series(BandPass(Price,1+10,0.5));
I know it, because I can plot all of them.

Re: Working with series inside arrays [Re: nanotir] #454868
09/26/15 15:08
09/26/15 15:08
Joined: Mar 2015
Posts: 336
Rogaland
N
nanotir Offline OP
Senior Member
nanotir  Offline OP
Senior Member
N

Joined: Mar 2015
Posts: 336
Rogaland
Finally I found way to extract the value of the series inside the array.
Firsy I defined an Array where each component is a series()

Quote:
vars Band_Array[60];
int i;
for(i=0;i<60;i++)
Band_Array[i] = series(DominantPeriod(Price,i+10));

So then Band_Array[0] is a series with i=0
My problem was how to extract just a component of the series so that I can get some information from it.
And this is the way

Quote:
int i;
var PD[60];
for(i=0;i<60;i++){
vars r = Band_Array[i];
PD[i]=r[0];}

So then PD[0] is the value of Band_Array[0] at Price[0]

Last edited by Nanitek; 09/26/15 15:09.

Moderated by  Petra 

Gamestudio download | chip programmers | 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