Announcement

Collapse
No announcement yet.

s/r bands covering candlesticks

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

  • s/r bands covering candlesticks

    I just downloaded esignal 10.0 and My s/r bands script is now covering my candlesticks. It was working fine before I upgraded.
    I enclosed a screencap and the following code.
    Thanks for any help.



    /************************************************** *******
    Alexis C. Montenegro © December 2004
    Use and/or modify this code freely. If you redistribute it
    please include this and/or any other comment blocks and a
    description of any changes you make.
    ************************************************** ********/

    var fpArray = new Array();

    function preMain() {

    setPriceStudy(true);
    setStudyTitle("S/R Bands");
    setDefaultBarFgColor(Color.grey,0);
    setDefaultBarFgColor(Color.grey,1);
    setDefaultBarFgColor(Color.grey,2);
    setDefaultBarFgColor(Color.grey,3);
    setDefaultBarFgColor(Color.black,4);
    setDefaultBarFgColor(Color.grey,5);
    setDefaultBarFgColor(Color.grey,6);
    setDefaultBarFgColor(Color.grey,7);
    setDefaultBarFgColor(Color.grey,8);
    setDefaultBarThickness(0,0);
    setDefaultBarThickness(0,1);
    setDefaultBarThickness(0,2);
    setDefaultBarThickness(0,3);
    setDefaultBarThickness(0,4);
    setDefaultBarThickness(0,5);
    setDefaultBarThickness(0,6);
    setDefaultBarThickness(0,7);
    setDefaultBarThickness(0,8);
    setPlotType(PLOTTYPE_FLATLINES,0);
    setPlotType(PLOTTYPE_FLATLINES,1);
    setPlotType(PLOTTYPE_FLATLINES,2);
    setPlotType(PLOTTYPE_FLATLINES,3);
    setPlotType(PLOTTYPE_FLATLINES,4);
    setPlotType(PLOTTYPE_FLATLINES,5);
    setPlotType(PLOTTYPE_FLATLINES,6);
    setPlotType(PLOTTYPE_FLATLINES,7);
    setPlotType(PLOTTYPE_FLATLINES,8);

    var x=0;
    fpArray[x] = new FunctionParameter("Interval", FunctionParameter.STRING);
    with(fpArray[x++]){
    setDefault();
    }
    fpArray[x] = new FunctionParameter("SR1", FunctionParameter.NUMBER);
    with(fpArray[x++]){
    setDefault(0.500);
    }
    fpArray[x] = new FunctionParameter("SR2", FunctionParameter.NUMBER);
    with(fpArray[x++]){
    setDefault(0.618);
    }
    fpArray[x] = new FunctionParameter("SR3", FunctionParameter.NUMBER);
    with(fpArray[x++]){
    setDefault(1.000);
    }
    fpArray[x] = new FunctionParameter("SR4", FunctionParameter.NUMBER);
    with(fpArray[x++]){
    setDefault(1.382);
    }
    fpArray[x] = new FunctionParameter("Colors", FunctionParameter.STRING);
    with(fpArray[x++]){
    addOption("ON");
    addOption("OFF");
    setDefault("ON");
    }
    fpArray[x] = new FunctionParameter("Params", FunctionParameter.BOOLEAN);
    with(fpArray[x++]){
    setName("Show Parameters");
    setDefault(false);
    }
    }

    var xHigh = null;
    var xLow = null;
    var xClose = null;
    var High_1 = null;
    var Low_1 = null;
    var Close_1 = null;
    var Rng = null;
    var vBal = null;
    var vUp1 = null;
    var vUp2 = null;
    var vUp3 = null;
    var vUp4 = null;
    var vDn1 = null;
    var vDn2 = null;
    var vDn3 = null;
    var vDn4 = null;
    var vInterval = null;
    var bInit = false;

    function main(Interval,SR1,SR2,SR3,SR4,Colors,Params) {

    if(bInit == false){
    if(isIntraday() && Interval == null) Interval = "D";
    else if(isDaily() && Interval == null) Interval = "W";
    else if(isWeekly() && Interval == null) Interval = "M";
    else if(Interval == null) Interval = getInterval();
    vInterval = Interval;
    xHigh = high(inv(vInterval));
    xLow = low(inv(vInterval));
    xClose = close(inv(vInterval));
    setCursorLabelName(SR4+" ", 0);
    setCursorLabelName(SR3+" ", 1);
    setCursorLabelName(SR2+" ", 2);
    setCursorLabelName(SR1+" ", 3);
    setCursorLabelName("Bal"+" ", 4);
    setCursorLabelName(SR1+" ", 5);
    setCursorLabelName(SR2+" ", 6);
    setCursorLabelName(SR3+" ", 7);
    setCursorLabelName(SR4+" ", 8);
    setShowTitleParameters(eval(Params));
    bInit = true;
    }

    if(getBarStateInterval(vInterval+"")==BARSTATE_NEW BAR){
    High_1 = xHigh.getValue(-1);
    Low_1 = xLow.getValue(-1);
    Close_1 = xClose.getValue(-1);
    Rng = High_1-Low_1;
    vBal = (High_1+Low_1+Close_1)/3;
    vUp1 = vBal+(Rng*SR1);
    vUp2 = vBal+(Rng*SR2);
    vUp3 = vBal+(Rng*SR3);
    vUp4 = vBal+(Rng*SR4);
    vDn1 = vBal-(Rng*SR1);
    vDn2 = vBal-(Rng*SR2);
    vDn3 = vBal-(Rng*SR3);
    vDn4 = vBal-(Rng*SR4);
    }
    if(High_1==null||Low_1==null||Close_1==null) return;

    if(Colors=="ON"){
    setBarBgColor(Color.grey,3,vUp1,vUp2);
    setBarBgColor(Color.grey,1,vUp3,vUp4);
    setBarBgColor(Color.grey,5,vDn2,vDn1);
    setBarBgColor(Color.grey,7,vDn4,vDn3);
    }

    return new Array(vUp4,vUp3,vUp2,vUp1,vBal,vDn1,vDn2,vDn3,vDn4 );
    }
    Attached Files

  • #2
    Re: s/r bands covering candlesticks

    dido
    The issue you are seeing is due to a bug that was introduced in version 10 and that has been fixed in the current beta release which is undergoing public testing at this time (see this thread for more information on the beta release)
    If you do not wish to run a beta version the only other option that I know of is to revert back to version 8 which can be downloaded here or to switch off the background coloring (using the Colors parameter in Edit Studies)
    Alex


    Originally posted by dido
    I just downloaded esignal 10.0 and My s/r bands script is now covering my candlesticks. It was working fine before I upgraded.
    I enclosed a screencap and the following code.
    Thanks for any help.

    Comment


    • #3
      older version

      thanks Alex. I reinstalled the older version.
      Thanks for the info.

      Comment


      • #4
        dido
        You are welcome
        Alex


        Originally posted by dido
        thanks Alex. I reinstalled the older version.
        Thanks for the info.

        Comment

        Working...
        X