Woodie_CCI.efs

ICE Data Services -

Woodie_CCI.efs  

File Name: Woodie_CCI.efs

Description:
The Woodie CCI is two CCI studies overlayed on each other. The main line in blue is a 14 period CCI based off of the High, Low and Close / 3. The secondary line in red, commonly referred to as a Turbo CCI, is a 6 period CCI also based off of the High, Low and Close / 3. Also, added to this study are 3 lines added at 200, 0, and -200 for reference.

Formula Parameters:
NA

Notes:
NA

Download File:
Woodie_CCI.efs




EFS Code:

/************************Copyright (c) eSignal, 2003*************************D
escription: The Woodie CCI is two CCI studies overlayed on each other.
The main line in blue is a 14 period CCI based off of the High, Low and Close / 3.
The secondary line in red, commonly referred to as a Turbo CCI, 
is a 6 period CCI also based off of the High, Low and Close / 3. 
Also, added to this study are 3 linesadded at 200, 0, and -200 for reference.
Version Control1.1 -- Added Support for a 34 period CCI, 
and the ability to turn features on/off in the Edit Studies window. 
Please note that 3rd CCI is the study that contains the histogram. */

var study1 = null;
var study2 = null;
var study3 = null;

function preMain() {
  addBand(200, PS_DOT, 2, Color.purple, "200");
  addBand(100, PS_SOLID, 1, Color.black, "100");
  addBand(0, PS_SOLID, 1, Color.grey, "zero");
  addBand(-100, PS_SOLID, 1, Color.black, "-100");
  addBand(-200, PS_DOT, 2, Color.yellow, "-200");
  setDefaultBarThickness(1, 0);
  setDefaultBarThickness(2, 1);
  setDefaultBarThickness(1, 2);
  setDefaultBarThickness(1, 3);
  setPlotType(PLOTTYPE_HISTOGRAM, 0);
  setStudyTitle("Woodies CCI");
  var fp1 = new FunctionParameter("nLength1", FunctionParameter.NUMBER);
  fp1.setName("1st CCI Length");
  fp1.setDefault(34);
  var fp2 = new FunctionParameter("nLength2", FunctionParameter.NUMBER);
  fp2.setName("2nd CCI Length");
  fp2.setDefault(6);
  var fp3 = new FunctionParameter("nLength3", FunctionParameter.NUMBER);
  fp3.setName("3rd CCI Length");
  fp3.setDefault(14);
  var fp4 = new FunctionParameter("nSource1", FunctionParameter.STRING);
  fp4.setName("1st CCI Source");
  fp4.addOption("Close");
  fp4.addOption("Open");
  fp4.addOption("High");
  fp4.addOption("Low");
  fp4.addOption("HL/2");
  fp4.addOption("HL/2");
  fp4.addOption("HLC/3");
  fp4.addOption("OHLC/4");
  fp4.setDefault("HLC/3");
  var fp5 = new FunctionParameter("nSource2", FunctionParameter.STRING);
  fp5.setName("2nd CCI Source");
  fp5.addOption("Close");
  fp5.addOption("Open");
  fp5.addOption("High");
  fp5.addOption("Low");
  fp5.addOption("HL/2");
  fp5.addOption("HL/2");
  fp5.addOption("HLC/3");
  fp5.addOption("OHLC/4");
  fp5.setDefault("HLC/3");
  var fp6 = new FunctionParameter("nSource3", FunctionParameter.STRING);
  fp6.setName("3rd CCI Source");
  fp6.addOption("Close");
  fp6.addOption("Open");
  fp6.addOption("High");
  fp6.addOption("Low");
  fp6.addOption("HL/2");
  fp6.addOption("HL/2");
  fp6.addOption("HLC/3");
  fp6.addOption("OHLC/4");
  fp6.setDefault("HLC/3");
  var fp7 = new FunctionParameter("nColor1", FunctionParameter.COLOR);
  fp7.setName("1st CCI Color");
  fp7.setDefault(Color.magenta);
  var fp8 = new FunctionParameter("nColor2", FunctionParameter.COLOR);
  fp8.setName("2nd CCI Color");
  fp8.setDefault(Color.red);
  var fp9 = new FunctionParameter("nColor3", FunctionParameter.COLOR);
  fp9.setName("3rd CCI Color");
  fp9.setDefault(Color.blue);
  setCursorLabelName("CCI," + nLengthString3, 0);
  setCursorLabelName("CCI," + nLengthString3, 1);
  setCursorLabelName("CCI," + nLengthString1, 2);
  setCursorLabelName("CCI," + nLengthString2, 3);
}
var nLengthString1 = "34";
var nLengthString2 = "6";
var nLengthString3 = "14";
var vParamChanged = true;

function main(
  nLength1,
  nLength2,
  nLength3,
  nSource1,
  nSource2,
  nSource3,
  nColor1,
  nColor2,
  nColor3
) {
  if (vParamChanged == true) {
    if (study1 == null) study1 = new CCIStudy(nLength1, nSource1);
    if (study2 == null) study2 = new CCIStudy(nLength2, nSource2);
    if (study3 == null) study3 = new CCIStudy(nLength3, nSource3);
    setDefaultBarFgColor(nColor3, 0);
    setDefaultBarFgColor(nColor3, 1);
    setDefaultBarFgColor(nColor1, 2);
    setDefaultBarFgColor(nColor2, 3);
    nLengthString1 = nLength1;
    nLengthString2 = nLength2;
    nLengthString3 = nLength3;
    preMain();
    vParamChanged = false;
  }
  var vCCI1 = study1.getValue(CCIStudy.CCI);
  var vCCI2 = study2.getValue(CCIStudy.CCI);
  var vCCI3 = study3.getValue(CCIStudy.CCI);
  return new Array(vCCI3, vCCI3, vCCI1, vCCI2);
}