I have the following code running in a real-time script.
var v1 = getValue("close",0,1,"$ADV");
var v2 = getValue("close",0,1,"$DECL");
var v3 = getValue("close",0,1,"$UCHG");
debugPrintln(v1+" "+v2+" "+v3);
var x2 = (v1 - v2);
var x1 = (v1 + v2 + v3);
debugPrintln(x2+" "+x1);
The first debug line prints: 692 2159 90
The second debug prints: -1467 692215990
Why do I get the correct answer for x2 but not for x1? Do the indexes return text values?
Thanks.
var v1 = getValue("close",0,1,"$ADV");
var v2 = getValue("close",0,1,"$DECL");
var v3 = getValue("close",0,1,"$UCHG");
debugPrintln(v1+" "+v2+" "+v3);
var x2 = (v1 - v2);
var x1 = (v1 + v2 + v3);
debugPrintln(x2+" "+x1);
The first debug line prints: 692 2159 90
The second debug prints: -1467 692215990
Why do I get the correct answer for x2 but not for x1? Do the indexes return text values?
Thanks.
Comment