Announcement

Collapse
No announcement yet.

Trouble thickening line

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

  • Trouble thickening line

    Can't seem to thicken up the red line. Put thickness codes in a few places but would not worl. Could you insert for red and black line. Thanks
    [email protected]
    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.grey,"100");
    addBand(0, PS_SOLID, 1, Color.grey,"zero");
    addBand(-100, PS_SOLID, 1, Color.grey,"-100");
    addBand(-200, PS_DOT, 2, Color.yellow,"-200");
    setDefaultBarFgColor(Color.lime, 0);
    setDefaultBarThickness(2,0);
    setDefaultBarThickness(2,1);
    setDefaultBarThickness(1,2);
    setDefaultBarThickness(1,3);

    setPlotType(PLOTTYPE_HISTOGRAM,0);
    setCursorLabelName("CCI");
    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.black);

    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);

    }

  • #2
    earlinarizona
    Change the first value in Line 16 (assuming the posted code starts with var study1 = null; at Line1)
    setDefaultBarThickness(1,3);
    Alex

    Comment

    Working...
    X