Hi,
Does an internal function [function bb()] called by another internal function [function aa()] inherit the sym() passed by main()?
And does a series calculation based on the called internal function (bb) also inherit the sym() passed by main()?
Hopefully the questions are clearer when commented in the sample script below.
I don't know how to test for this andn othing I've tried so far clears this up for me.
Thanks in advance.
Wayne
Does an internal function [function bb()] called by another internal function [function aa()] inherit the sym() passed by main()?
And does a series calculation based on the called internal function (bb) also inherit the sym() passed by main()?
Hopefully the questions are clearer when commented in the sample script below.
PHP Code:
var Study = null;
var bInit = false;
function main(){
if(!bInit){
Symbol = getSymbol();
Interval = getInterval();
var xSymbol = Symbol+","+Interval;
study = efsInternal("aa",sym(xSymbol));
bInit=true;
}
...
}
function aa(){
xTR = efsInternal("bb");//Does "function aa()" pass "sym(xSymbol)" to "function bb()"?
xAvgTR = ema(MALength, xTR);//is "xAvgTR" calculated based on "sym(xSymbol) since "xAvgTR is based on "function bb()"?
}
function bb(){//if "sym(xSymbol)" is not passed how do I make sure the whole script is based on the desired symbol and interval?
return (high(0)-low(0));
}
Thanks in advance.
Wayne
Comment