I would like to put ADX and Stochastics in one panel and am having trouble. Below is the formula I have been working on but it is not working. Any persons help would be appreciated. It starts with cut and past from builtin stochastics and builtin ADX
var study = new ADXDMStudy(14, 14);
var study = new StochStudy(14, 3, 3);
function preMain() {
setStudyTitle("Joined ADX and Stochastic");
setCursorLabelName("AMX",0);
setCursorLabelName("AMX+",1);
setCursorLabelName("AMX-",2);
setCursorLabelName("K%",3);
setCursorLabelName("D%",4);
setStudyMin(0);
setStudyMax(100);
setDefaultBarFgColor(Color.yellow, 0); // ADX
setDefaultBarFgColor(Color.blue, 1); // PDI
setDefaultBarFgColor(Color.red, 2); // NDI
setDefaultBarFgColor(Color.blue, 3); // %K
setDefaultBarFgColor(Color.red, 4); // %D
setDefaultBarThickness(3,0);
setDefaultBarThickness(3,1);
setDefaultBarThickness(3,2);
setDefaultBarThickness(3,3);
setDefaultBarThickness(3,4);
}
function main() {
var vADX = study.getValue(ADXDMStudy.ADX);
var vPDI = study.getValue(ADXDMStudy.PDI);
var vNDI = study.getValue(ADXDMStudy.NDI);
var vFast = study.getValue(StochStudy.FAST);
var vSlow = study.getValue(StochStudy.SLOW);
return new Array(vADX, vPDI, vNDI,vFast, vSlow);
}
var study = new ADXDMStudy(14, 14);
var study = new StochStudy(14, 3, 3);
function preMain() {
setStudyTitle("Joined ADX and Stochastic");
setCursorLabelName("AMX",0);
setCursorLabelName("AMX+",1);
setCursorLabelName("AMX-",2);
setCursorLabelName("K%",3);
setCursorLabelName("D%",4);
setStudyMin(0);
setStudyMax(100);
setDefaultBarFgColor(Color.yellow, 0); // ADX
setDefaultBarFgColor(Color.blue, 1); // PDI
setDefaultBarFgColor(Color.red, 2); // NDI
setDefaultBarFgColor(Color.blue, 3); // %K
setDefaultBarFgColor(Color.red, 4); // %D
setDefaultBarThickness(3,0);
setDefaultBarThickness(3,1);
setDefaultBarThickness(3,2);
setDefaultBarThickness(3,3);
setDefaultBarThickness(3,4);
}
function main() {
var vADX = study.getValue(ADXDMStudy.ADX);
var vPDI = study.getValue(ADXDMStudy.PDI);
var vNDI = study.getValue(ADXDMStudy.NDI);
var vFast = study.getValue(StochStudy.FAST);
var vSlow = study.getValue(StochStudy.SLOW);
return new Array(vADX, vPDI, vNDI,vFast, vSlow);
}
Comment