Hi,
Are there any restrictions in using calculated vars/constants in functions used with efsInternal?
If yes, are they explained anywhere?
Here is the problem:
var AvB;
stMA1;
stMA2;
stOsc;
function main() {
if (ALLBARS) {
AvB = ...; //Calculate it, so I can use it in other studies
stMA1 = ...
stMA2 = ...
stOsc12 = efsInternal("MyOscF",stMA1,stMA2); //This does not work
stOsc12 = efsInternal("MyOscF1",stMA1,stMA2,AvB); //This works
}
}
function MyOscF(stMAf,stMAs) {
return (stMAf-stMAs)/AvB;
}
function MyOscF1(stMAf,stMAs,XX) {
return (stMAf-stMAs)/XX;
}
MyOscF return only nulls;
MyOscF1 works fine, but it is not what I want because I may have many other vars I want to be able to use.
Looks like, efsInternal is not able to "look" for a global vars declared/calculated in efs.
Can anybody explain if there is such restriction, or I am doing something wrong here?
Note: I did try to declare a local var inside MyOscF, but still does not work.
Thank you.
Are there any restrictions in using calculated vars/constants in functions used with efsInternal?
If yes, are they explained anywhere?
Here is the problem:
var AvB;
stMA1;
stMA2;
stOsc;
function main() {
if (ALLBARS) {
AvB = ...; //Calculate it, so I can use it in other studies
stMA1 = ...
stMA2 = ...
stOsc12 = efsInternal("MyOscF",stMA1,stMA2); //This does not work
stOsc12 = efsInternal("MyOscF1",stMA1,stMA2,AvB); //This works
}
}
function MyOscF(stMAf,stMAs) {
return (stMAf-stMAs)/AvB;
}
function MyOscF1(stMAf,stMAs,XX) {
return (stMAf-stMAs)/XX;
}
MyOscF return only nulls;
MyOscF1 works fine, but it is not what I want because I may have many other vars I want to be able to use.
Looks like, efsInternal is not able to "look" for a global vars declared/calculated in efs.
Can anybody explain if there is such restriction, or I am doing something wrong here?
Note: I did try to declare a local var inside MyOscF, but still does not work.
Thank you.
Comment