I see in the beta news: SeriesLength. Do you mean this feature?

SeriesLength
int, r/o, containing the number of elements of the date series returned by the last series() call.
https://zorro-project.com/manual/en/series.htm

With this way I still need to store the series length somewhere.

Because what if I want to get the length of a series, but not the last one I called by the command series()? Or do some calculations with multiple series?
For example like this:

Code
double doSomething(var* series){
    for (int i = 0; i<(*series).length(); i++){
        //...calc something
    }
}

double doSomethingElse(var* series, var* series2){
    for (int i = 0; i<(*series).length(); i++){
        for (int j = 0; j<(*series2).length(); j++){
            //...calc something with (*series)[i] and (*series2)[j]
        }
    }
}
...
function run(){

    ...

    priceM1 = series(priceClose(0), 100);
    TimeFrame = 5;
    priceM5 = series(priceClose(0), 250);

    double result = 0;

    double someThing1 = doSomething(&priceM1);
    if (someThing1 >= 0.5){
        double someThing2 = doSomething(&priceM5);
        if (someThing2 >= 0.5){
                result = doSomethingElse(&priceM1, &priceM5);
        }
    }

    ...

}


It would be nice if I could ask exactly from the series itself. For example like this:

Code
vars a = series(0, 100);
int length = a.length();


Or like this:

Code
vars a = series(0, 100);
int length = getSeriesLength(a);

Last edited by NorbertSz; 09/15/22 11:18.