In this example, would v34EMA ever be null after this line:
v34EMA = ema(34,0);
was executed?
v34EMA = ema(34,0);
was executed?
Originally posted by Alexis C. Montenegro
John
In addition to what Steve said if you want to use .toFixed() you need to run a null check on the value first.
The enclosed revision of your script should now work
Alex
John
In addition to what Steve said if you want to use .toFixed() you need to run a null check on the value first.
The enclosed revision of your script should now work
Alex
PHP Code:
var v34EMA = null;
function preMain() {
setPriceStudy(true);
}
function main() {
v34EMA = ema(34,0);
if(v34EMA==null) return;
//return("34="+v34EMA);
return("34="+v34EMA.toFixed(3));
}
Comment