In order to use an array for several different moving averages I need to eval() a variable containing text with .getValue(0). However I get a null response when I debugPrintln().
How do I correct the following script to output the correct .getValue(0) and .getValue(-1).
Thank you.
var myStudy = null;
var vInit = false;
function main(){
if(vInit == false){
vCommonVar6 = ema( 34 , close(sym("ibm,5")));
vSymbol = getSymbol() + ","
vInit=true
}
var vCommonVar7 = vCommonVar6 + ".getValue(0)"
var vCommonVar8 = vCommonVar6 + ".getValue(-1)"
debugPrintln(eval(vCommonVar7));
debugPrintln(eval(vCommonVar8));
}
How do I correct the following script to output the correct .getValue(0) and .getValue(-1).
Thank you.
var myStudy = null;
var vInit = false;
function main(){
if(vInit == false){
vCommonVar6 = ema( 34 , close(sym("ibm,5")));
vSymbol = getSymbol() + ","
vInit=true
}
var vCommonVar7 = vCommonVar6 + ".getValue(0)"
var vCommonVar8 = vCommonVar6 + ".getValue(-1)"
debugPrintln(eval(vCommonVar7));
debugPrintln(eval(vCommonVar8));
}
Comment