I need help trying to add bands at the -20 and the -80 to the "builtinPercentR" study. I did a search in the forum for "add band" and didn't find anything relevant to what i'm trying to do.
I added this thinking it would work -
addBand(-20, PS_SOLID, 2, Color.yellow, "a");
addBand(-80, PS_SOLID, 2, Color.black, "b");
It didn't
here's how it looks in the study -
/************************************************** *******
Alexis C. Montenegro © July 2003
Use and/or modify this code freely. If you redistribute it
please include this and/or any other comment blocks and a
description of any changes you make.
************************************************** ********/
var vPercentR = null;
function preMain() {
setStudyTitle("PercentR");
setCursorLabelName("%R", 0);
setDefaultBarFgColor(Color.blue, 0);
setDefaultBarThickness(1,0);
addBand(-20, PS_SOLID, 2, Color.yellow, "a");
addBand(-80, PS_SOLID, 2, Color.black, "b");
var fp1 = new FunctionParameter("Length", FunctionParameter.NUMBER);
fp1.setLowerLimit(1);
fp1.setDefault(10); //Edit this value to set a new default
}
function main(Length) {
if (vPercentR == null) vPercentR = new PercentRStudy(Length);
/************************************************** *********
Insert your code following this text block
Use vPercentR.getValue(PercentRStudy.PERCENTR) for your code
************************************************** **********/
return vPercentR.getValue(PercentRStudy.PERCENTR);
}
Any help is appreciated.
I added this thinking it would work -
addBand(-20, PS_SOLID, 2, Color.yellow, "a");
addBand(-80, PS_SOLID, 2, Color.black, "b");
It didn't
here's how it looks in the study -
/************************************************** *******
Alexis C. Montenegro © July 2003
Use and/or modify this code freely. If you redistribute it
please include this and/or any other comment blocks and a
description of any changes you make.
************************************************** ********/
var vPercentR = null;
function preMain() {
setStudyTitle("PercentR");
setCursorLabelName("%R", 0);
setDefaultBarFgColor(Color.blue, 0);
setDefaultBarThickness(1,0);
addBand(-20, PS_SOLID, 2, Color.yellow, "a");
addBand(-80, PS_SOLID, 2, Color.black, "b");
var fp1 = new FunctionParameter("Length", FunctionParameter.NUMBER);
fp1.setLowerLimit(1);
fp1.setDefault(10); //Edit this value to set a new default
}
function main(Length) {
if (vPercentR == null) vPercentR = new PercentRStudy(Length);
/************************************************** *********
Insert your code following this text block
Use vPercentR.getValue(PercentRStudy.PERCENTR) for your code
************************************************** **********/
return vPercentR.getValue(PercentRStudy.PERCENTR);
}
Any help is appreciated.
Comment