I am trying to figure out what this function does...the example code gives an error. Please advise.
var bInit = false;
var xSeriesMA = null;
var fpArray = new Array();
function preMain(){
setPriceStudy(true);
setStudyTitle("Moving Average");
setOnApply();
var x=0;
fpArray[x] = new FunctionParameter("Length",FunctionParameter.NUMBE R);
with(fpArray[x++]){
setLowerLimit(1);
setDefault(20);
}
};
function main(Length){
if(bInit == false){
setColorPriceBars(true);
xSeriesMA = getSeries(sma(Length));
bInit = true;
};
return xSeriesMA;
}
var bInit = false;
var xSeriesMA = null;
var fpArray = new Array();
function preMain(){
setPriceStudy(true);
setStudyTitle("Moving Average");
setOnApply();
var x=0;
fpArray[x] = new FunctionParameter("Length",FunctionParameter.NUMBE R);
with(fpArray[x++]){
setLowerLimit(1);
setDefault(20);
}
};
function main(Length){
if(bInit == false){
setColorPriceBars(true);
xSeriesMA = getSeries(sma(Length));
bInit = true;
};
return xSeriesMA;
}
Comment