Working with series inside arrays

Posted By: nanotir

Working with series inside arrays - 09/25/15 15:43

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?
Posted By: yosoytrader

Re: Working with series inside arrays - 09/25/15 15:47

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
Posted By: nanotir

Re: Working with series inside arrays - 09/25/15 16:59

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.
Posted By: nanotir

Re: Working with series inside arrays - 09/26/15 15:08

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]
© 2024 lite-C Forums