I am having trouble in figuring out the following.
If the difference between the red and lime line ( + _) is greater then 10, change background color to magenta.
Currently it changes color if + is greater then - then green background appears and opposite for - greater then +
var study = new ADXDMStudy(6, 6);
function preMain() {
setStudyTitle("ADX 6 6");
setDefaultBarFgColor(Color.green, 0); // ADX
setDefaultBarFgColor(Color.lime, 1); // PDI
setDefaultBarFgColor(Color.red, 2); // NDI
setDefaultBarFgColor(Color.darkgrey, 3);
setDefaultBarThickness(2,3);
setCursorLabelName("0",0);
setCursorLabelName("+",1);
setCursorLabelName("-",2);
setCursorLabelName("0",3);
setDefaultBarThickness(0,0);
setDefaultBarThickness(2,1);
setDefaultBarThickness(2,2);
setPlotType(PLOTTYPE_INSTANTCOLORLINE);
setStudyMin(0);
setStudyMax(50);
}
function main() {
var vADX = study.getValue(ADXDMStudy.ADX);
var vPDI = study.getValue(ADXDMStudy.PDI);
var vNDI = study.getValue(ADXDMStudy.NDI);
var UpBand1 = 45;
if(vPDI > vNDI)
{
setBarBgColor(Color.green);
}
if(vPDI < vNDI)
{
setBarBgColor(Color.maroon);
}
return new Array(vADX, vPDI, vNDI, UpBand1);
}
If the difference between the red and lime line ( + _) is greater then 10, change background color to magenta.
Currently it changes color if + is greater then - then green background appears and opposite for - greater then +
var study = new ADXDMStudy(6, 6);
function preMain() {
setStudyTitle("ADX 6 6");
setDefaultBarFgColor(Color.green, 0); // ADX
setDefaultBarFgColor(Color.lime, 1); // PDI
setDefaultBarFgColor(Color.red, 2); // NDI
setDefaultBarFgColor(Color.darkgrey, 3);
setDefaultBarThickness(2,3);
setCursorLabelName("0",0);
setCursorLabelName("+",1);
setCursorLabelName("-",2);
setCursorLabelName("0",3);
setDefaultBarThickness(0,0);
setDefaultBarThickness(2,1);
setDefaultBarThickness(2,2);
setPlotType(PLOTTYPE_INSTANTCOLORLINE);
setStudyMin(0);
setStudyMax(50);
}
function main() {
var vADX = study.getValue(ADXDMStudy.ADX);
var vPDI = study.getValue(ADXDMStudy.PDI);
var vNDI = study.getValue(ADXDMStudy.NDI);
var UpBand1 = 45;
if(vPDI > vNDI)
{
setBarBgColor(Color.green);
}
if(vPDI < vNDI)
{
setBarBgColor(Color.maroon);
}
return new Array(vADX, vPDI, vNDI, UpBand1);
}
Comment