Hi,
I get a different value for the CCI if I hard code the source or use a variable. How come?
function preMain() {
setPriceStudy(false);
setStudyTitle("CCI");
setCursorLabelName("CCI",0);
setCursorLabelName("CCI Var",1);
setDefaultBarFgColor(Color.blue,0);
setDefaultBarThickness(2,0);
}
var cbCCI_Var = 0;
var cbCCI = 0;
var nCCIPeriod = 14;
var nCCISource = "hlc3()";
function main() {
cbCCI = cci(14,hlc3()).toFixed(2)*1;
cbCCI_Var = cci(14,nCCISource).toFixed(2)*1;
var retArray = new Array(2);
setBarFgColor(Color.blue, 0);
setBarFgColor(Color.red, 1);
retArray[0] = cbCCI;
retArray[1] = cbCCI_Var;
return retArray;
}
Attached should be a screen shot.
How do you get a screen shot into the text?
Tom
I get a different value for the CCI if I hard code the source or use a variable. How come?
function preMain() {
setPriceStudy(false);
setStudyTitle("CCI");
setCursorLabelName("CCI",0);
setCursorLabelName("CCI Var",1);
setDefaultBarFgColor(Color.blue,0);
setDefaultBarThickness(2,0);
}
var cbCCI_Var = 0;
var cbCCI = 0;
var nCCIPeriod = 14;
var nCCISource = "hlc3()";
function main() {
cbCCI = cci(14,hlc3()).toFixed(2)*1;
cbCCI_Var = cci(14,nCCISource).toFixed(2)*1;
var retArray = new Array(2);
setBarFgColor(Color.blue, 0);
setBarFgColor(Color.red, 1);
retArray[0] = cbCCI;
retArray[1] = cbCCI_Var;
return retArray;
}
Attached should be a screen shot.
How do you get a screen shot into the text?
Tom
Comment