I'd like to get a function of multiple series and the function's output as a series as well. So I thought I'd achieve that via efsInternal. But EFS gets hung on the following code:
var s1 = sma(10);
var s2 = sma(50);
var dS = null;
var bInit = false;
function preMain () {
... usual stuff ...
}
function main() {
if (getBarState() == BARSTATE_ALLBARS) return;
if (bInit == false) {
bInit=true;
if (dS==null) dS=efsInternal("calc_f");
}
var dSs = getSeries(dS, 0);
// then do something with dSs
}
function calc_f() {
return (getSeries(s1) -getSeries(s2));
}
I am sure I am misunderstanding something here about getSeries()...
any help would be greatly appreciated.
ziggy
var s1 = sma(10);
var s2 = sma(50);
var dS = null;
var bInit = false;
function preMain () {
... usual stuff ...
}
function main() {
if (getBarState() == BARSTATE_ALLBARS) return;
if (bInit == false) {
bInit=true;
if (dS==null) dS=efsInternal("calc_f");
}
var dSs = getSeries(dS, 0);
// then do something with dSs
}
function calc_f() {
return (getSeries(s1) -getSeries(s2));
}
I am sure I am misunderstanding something here about getSeries()...
any help would be greatly appreciated.
ziggy
Comment