This is a continuation of my previous post.
Alex,
I will summarize what I understood from other posts, please confirm is true or correct me:
1. Yes, we can return arrays with efsInternal.
2. efsInternal will generate a multi-dimesional array that can be accessed only using first "getSeries" to create individual series objects
3. After those series objects are created, we can retireve historical values using getValue.
In other words, we cannot access directly the multi-dimensional array created with efsInternal same way we access other arrays we generate.
For example, if
var MyEfsInternalStudy = efsInternal("MyFunction");
generates multiple series, we cannot do
var MyHistVal_Y_X = MyEfsInternalStudy[x][y],
where x is the BarIndex and y is the SeriesIndex.
nor we can use an EFS1 like syntax [as I expected to be available]
var MyHistVal_Y_X = getSeries(MyEfsInternalStudy.getValue(x),y)
or something similar, because (a) efsInternal does not return an object but an array and (b) getSeries accepts only one parameter.
Instead, must do it in two steps [except for the first series]
Step1: Generate the individual series objects
var MySubStudy1 = getSeries(MyEfsInternalStudy,0);
var MySubStudy2 = getSeries(MyEfsInternalStudy,1);
...
var MySubStudyY = getSeries(MyEfsInternalStudy,y);
Step2: Retrieve historical values for the Y study, as for any other study [using BarIndex, negative value]
var MyHistVal_Y_X = MySubStudyY.getValue(x),
Is my understanding correct?
NOTE: Maybe returning an array of objects with efsInternal [like EFS1 does] is not a bad idea. It would preserve EFS2 ease of use with the flexibility in EFS1.
Thank you
Alex,
I will summarize what I understood from other posts, please confirm is true or correct me:
1. Yes, we can return arrays with efsInternal.
2. efsInternal will generate a multi-dimesional array that can be accessed only using first "getSeries" to create individual series objects
3. After those series objects are created, we can retireve historical values using getValue.
In other words, we cannot access directly the multi-dimensional array created with efsInternal same way we access other arrays we generate.
For example, if
var MyEfsInternalStudy = efsInternal("MyFunction");
generates multiple series, we cannot do
var MyHistVal_Y_X = MyEfsInternalStudy[x][y],
where x is the BarIndex and y is the SeriesIndex.
nor we can use an EFS1 like syntax [as I expected to be available]
var MyHistVal_Y_X = getSeries(MyEfsInternalStudy.getValue(x),y)
or something similar, because (a) efsInternal does not return an object but an array and (b) getSeries accepts only one parameter.
Instead, must do it in two steps [except for the first series]
Step1: Generate the individual series objects
var MySubStudy1 = getSeries(MyEfsInternalStudy,0);
var MySubStudy2 = getSeries(MyEfsInternalStudy,1);
...
var MySubStudyY = getSeries(MyEfsInternalStudy,y);
Step2: Retrieve historical values for the Y study, as for any other study [using BarIndex, negative value]
var MyHistVal_Y_X = MySubStudyY.getValue(x),
Is my understanding correct?
NOTE: Maybe returning an array of objects with efsInternal [like EFS1 does] is not a bad idea. It would preserve EFS2 ease of use with the flexibility in EFS1.
Thank you
Comment