Hi,
please see function below for details. What I am trying to do is compare the relative distances between ADX, PDI and NDI and apply some buy/sell rules based on the results.
I would like 5 previous bars of data for ADX, PDI and NDI. What is the syntax for grabbing and referencing these bars? If I can print them to the debug window that will be sufficient and I can plod on my merry way. Thanks for your help.
Regards,
Sal
var study = new ADXDMStudy(14, 14);
function preMain() {
setDefaultBarFgColor(Color.white, 0); // ADX
setDefaultBarFgColor(Color.lightyellow, 1); // PDI
setDefaultBarFgColor(Color.black, 2); // NDI
}
var BarCntr = 0;
function main() {
var vADX = study.getValue(ADXDMStudy.ADX);
var vPDI = study.getValue(ADXDMStudy.PDI);
var vNDI = study.getValue(ADXDMStudy.NDI);
debugPrintln("vNDI Historical values: " + vNDI(0) + " , " + vNDI(-1) + " , " .... etc );
return new Array(vADX, vPDI, vNDI);
}
please see function below for details. What I am trying to do is compare the relative distances between ADX, PDI and NDI and apply some buy/sell rules based on the results.
I would like 5 previous bars of data for ADX, PDI and NDI. What is the syntax for grabbing and referencing these bars? If I can print them to the debug window that will be sufficient and I can plod on my merry way. Thanks for your help.
Regards,
Sal
var study = new ADXDMStudy(14, 14);
function preMain() {
setDefaultBarFgColor(Color.white, 0); // ADX
setDefaultBarFgColor(Color.lightyellow, 1); // PDI
setDefaultBarFgColor(Color.black, 2); // NDI
}
var BarCntr = 0;
function main() {
var vADX = study.getValue(ADXDMStudy.ADX);
var vPDI = study.getValue(ADXDMStudy.PDI);
var vNDI = study.getValue(ADXDMStudy.NDI);
debugPrintln("vNDI Historical values: " + vNDI(0) + " , " + vNDI(-1) + " , " .... etc );
return new Array(vADX, vPDI, vNDI);
}
Comment