Announcement

Collapse
No announcement yet.

Woodie CCI

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Woodie CCI

    I like the combining of 4 efs into 1 nice and versatile one but I can't stand the values that show up in the title (which is edited to read cci in the attached chart.) If any changes are made to this efs the result is that huge overlay that potentially blots out chart information. Can something be done to eliminate or at least minimize this?

    Brian

    /************************
    Copyright © eSignal, 2003
    *************************

    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.

    Version Control

    1.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_SOLID, 2, Color.green,"200");
    addBand(100, PS_DOT, 1, Color.red,"100");
    addBand(0, PS_SOLID, 1, Color.grey,"zero");
    addBand(-100, PS_DOT, 1, Color.red,"-100");
    addBand(-200, PS_SOLID, 2, Color.green,"-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);

    }
    Attached Files

  • #2
    Brian
    If using 7.4 RC4 you have an option to hide all the study titles in a chart. To do this right click on the chart, select Properties then uncheck "Draw Study Titles".
    Another option is to reduce some of the FunctionParameters in preMain(), in particular the ones used to set the colors (fp7, fp8 and fp9) as they return a long list of numbers in the study title.
    Just some ideas
    Alex

    Comment


    • #3
      Thanks for the tip Alex. I'm using 7.3 and look forward to this new feature. Hope it works on basic studies as well as formulas.

      Comment

      Working...
      X