Ok I'm trying to create an ADX crossover alert alone...meaning that this EFS will not include the either one of the DI lines.
I'm starting off with trying to include upper and lower bands....but keep getting an error message.
Here is the code, can someone advise on what part is incorrect or missing?
It won't let me continue with the code until I fix the error.
Thanks.
var vADX = null;
function preMain() {
setStudyTitle("ADX");
setCursorLabelName("ADX", 0);
setDefaultBarFgColor(Color.magenta,0);
setPlotType(PLOTTYPE_LINE,0);
setDefaultBarThickness(2,0);
setStudyMin(0);
setStudyMax(100);
var fp1 = new FunctionParameter("Length", FunctionParameter.NUMBER);
fp1.setLowerLimit(1);
fp1.setDefault(14); //Edit this value to set a new default
var fp2 = new FunctionParameter("Upper", FunctionParameter.NUMBER);
fp2.setLowerLimit(0);
fp2.setDefault(50); //Edit this value to set a new default
var fp3 = new FunctionParameter("Lower", FunctionParameter.NUMBER);
fp3.setLowerLimit(0);
fp3.setDefault(20); //Edit this value to set a new default
}
function main(Length, Upper, Lower) {
if (vADX == null) vADX = new ADXStudy(Length);
addBand(Upper,PS_SOLID,1,Color.black,1);
addBand(Lower,PS_SOLID,1,Color.black,2);
return vADX.getValue(ADXStudy.ADX);
}
I'm starting off with trying to include upper and lower bands....but keep getting an error message.
Here is the code, can someone advise on what part is incorrect or missing?
It won't let me continue with the code until I fix the error.
Thanks.
var vADX = null;
function preMain() {
setStudyTitle("ADX");
setCursorLabelName("ADX", 0);
setDefaultBarFgColor(Color.magenta,0);
setPlotType(PLOTTYPE_LINE,0);
setDefaultBarThickness(2,0);
setStudyMin(0);
setStudyMax(100);
var fp1 = new FunctionParameter("Length", FunctionParameter.NUMBER);
fp1.setLowerLimit(1);
fp1.setDefault(14); //Edit this value to set a new default
var fp2 = new FunctionParameter("Upper", FunctionParameter.NUMBER);
fp2.setLowerLimit(0);
fp2.setDefault(50); //Edit this value to set a new default
var fp3 = new FunctionParameter("Lower", FunctionParameter.NUMBER);
fp3.setLowerLimit(0);
fp3.setDefault(20); //Edit this value to set a new default
}
function main(Length, Upper, Lower) {
if (vADX == null) vADX = new ADXStudy(Length);
addBand(Upper,PS_SOLID,1,Color.black,1);
addBand(Lower,PS_SOLID,1,Color.black,2);
return vADX.getValue(ADXStudy.ADX);
}
Comment