KeltnerMCEmaBandsAdj.efs

ICE Data Services -

KeltnerMCEmaBandsAdj.efs    

File Name: KeltnerMCEmaBandsAdj.efs

Description:
Keltner study with bands based on a fixed multiplier constant expressed as a percentage of the basis line above and below the basis line.

Formula Parameters:

  • nInputLength: Default is 8 (length for EMA).
  • nMultiplierConstant: Default is 0.013 (number may also be entered as 1.3).

Notes:
NA

Download File:
KeltnerMCEmaBandsAdj.efs


EFS Code:

/****************************************************************************************************
Copyright © eSignal, a division of Interactive Data Corporation. 2003. All rights reserved. 
This sample eSignal Formula Script (EFS) may be modified and saved under a new 
filename; however, eSignal is no longer responsible for the functionality once modified.
eSignal reserves the right to modify and overwrite this EFS file with each new release.
*****************************************************************************************************/
function preMain() {
    setPriceStudy(true);    
    setStudyTitle("EMA Keltner w/ Constant Bands");
    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
}


function main(nInputLength, nMultiplierConstant) {
	if(nInputLength == null)
		nInputLength = 8;
	if(nInputLength <= 0)
		nInputLength = 8;
    if (nMultiplierConstant != null) {
        if (nMultiplierConstant > 1) nMultiplierConstant /= 100;
        nMultiplierConstant = nMultiplierConstant*1;
    } else {
        nMultiplierConstant = 0.013;
    }

	var dKeltnerBasis= call("/Library/KeltnerEMA.efs", nInputLength);
	if(dKeltnerBasis == null) return;

	return new Array(dKeltnerBasis + (nMultiplierConstant * dKeltnerBasis), dKeltnerBasis, dKeltnerBasis - (nMultiplierConstant * dKeltnerBasis));
}