I see in the beta news: SeriesLength. Do you mean this feature?
SeriesLengthint, r/o, containing the number of elements of the date series returned
by the last series() call.
https://zorro-project.com/manual/en/series.htmWith 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:
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:
vars a = series(0, 100);
int length = a.length();
Or like this:
vars a = series(0, 100);
int length = getSeriesLength(a);