I would like to change the channel band to an (8,1.3%,1.3%). That is an 8 exponential moving average with a 1.3% above and below multiplier constant. Can any one tell me what needs to be changed on this page?
function preMain() {
setPriceStudy(true);
/* Set the title that will appear in the study pane */
setStudyTitle("Keltner EMA Bands");
/* Set the label that will appear in the cursor window */
setCursorLabelName("K-Upper", 0);
setCursorLabelName("K-Basis", 1);
setCursorLabelName("K-Lower", 2);
setDefaultBarFgColor(Color.blue, 0); // upper
setDefaultBarFgColor(Color.red, 1); // basis
setDefaultBarFgColor(Color.blue, 2); // lower
var fp1 = new FunctionParameter("nInputLength", FunctionParameter.NUMBER);
fp1.setName("Length");
fp1.setLowerLimit(1);
fp1.setDefault(10);
}
var xHminL = null;
var xKeltnerEMA = null;
function main(nInputLength) {
if (xHminL == null) xHminL = efsInternal("HminL", nInputLength);
if (xKeltnerEMA == null) xKeltnerEMA = ema(nInputLength, hlc3());
var nKeltnerBasis = xKeltnerEMA.getValue(0);
var nHminL = xHminL.getValue(0);
if (nKeltnerBasis == null || nHminL == null) return;
return new Array(nKeltnerBasis + nHminL, nKeltnerBasis, nKeltnerBasis - nHminL);
}
function HminL(n) {
var dHminL = 0;
for (var i = 0; i < n; i++) {
dHminL += high(-i) - low(-i);
}
return (dHminL /= n);
}
function preMain() {
setPriceStudy(true);
/* Set the title that will appear in the study pane */
setStudyTitle("Keltner EMA Bands");
/* Set the label that will appear in the cursor window */
setCursorLabelName("K-Upper", 0);
setCursorLabelName("K-Basis", 1);
setCursorLabelName("K-Lower", 2);
setDefaultBarFgColor(Color.blue, 0); // upper
setDefaultBarFgColor(Color.red, 1); // basis
setDefaultBarFgColor(Color.blue, 2); // lower
var fp1 = new FunctionParameter("nInputLength", FunctionParameter.NUMBER);
fp1.setName("Length");
fp1.setLowerLimit(1);
fp1.setDefault(10);
}
var xHminL = null;
var xKeltnerEMA = null;
function main(nInputLength) {
if (xHminL == null) xHminL = efsInternal("HminL", nInputLength);
if (xKeltnerEMA == null) xKeltnerEMA = ema(nInputLength, hlc3());
var nKeltnerBasis = xKeltnerEMA.getValue(0);
var nHminL = xHminL.getValue(0);
if (nKeltnerBasis == null || nHminL == null) return;
return new Array(nKeltnerBasis + nHminL, nKeltnerBasis, nKeltnerBasis - nHminL);
}
function HminL(n) {
var dHminL = 0;
for (var i = 0; i < n; i++) {
dHminL += high(-i) - low(-i);
}
return (dHminL /= n);
}
Comment