Hello.
why is not possible to do mathematical operations with user series ???
For instance, I'd like to display the Bollinger Bands difference:
var bInit = false;
var vSymbol = null;
var xUpperBB = null;
var xLowerBB = null;
var xDiffBB = null;
function main(PeriodoBB,CoefBB,Source,Symbol,Interval){
if ( !bInit ){
if(Symbol == null) Symbol = getSymbol();
if(Interval == null) Interval = getInterval();
vSymbol = Symbol+","+Interval;
xUpperBB = upperBB(PeriodoBB,CoefBB,eval(Source)(sym(vSymbol) )); // <<< User serie one
xLowerBB = lowerBB(PeriodoBB,CoefBB,eval(Source)(sym(vSymbol) )); // <<< User serie two
//I think the next sentence doesn't work !!!
xDiffBB = upperBB(PeriodoBB,CoefBB,eval(Source)(sym(vSymbol) )) - lowerBB(PeriodoBB,CoefBB,eval(Source)(sym(vSymbol) ));
bInit = true;
}
return xDiffBB.getValue(0); " <<< DON'T WORK !!!
}
I don't understand the cause. Please, could you help me? Thanks very much.
why is not possible to do mathematical operations with user series ???
For instance, I'd like to display the Bollinger Bands difference:
var bInit = false;
var vSymbol = null;
var xUpperBB = null;
var xLowerBB = null;
var xDiffBB = null;
function main(PeriodoBB,CoefBB,Source,Symbol,Interval){
if ( !bInit ){
if(Symbol == null) Symbol = getSymbol();
if(Interval == null) Interval = getInterval();
vSymbol = Symbol+","+Interval;
xUpperBB = upperBB(PeriodoBB,CoefBB,eval(Source)(sym(vSymbol) )); // <<< User serie one
xLowerBB = lowerBB(PeriodoBB,CoefBB,eval(Source)(sym(vSymbol) )); // <<< User serie two
//I think the next sentence doesn't work !!!
xDiffBB = upperBB(PeriodoBB,CoefBB,eval(Source)(sym(vSymbol) )) - lowerBB(PeriodoBB,CoefBB,eval(Source)(sym(vSymbol) ));
bInit = true;
}
return xDiffBB.getValue(0); " <<< DON'T WORK !!!
}
I don't understand the cause. Please, could you help me? Thanks very much.
Comment