Announcement

Collapse
No announcement yet.

Ma Rsi

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

  • Ma Rsi

    Alex:

    I've been playing around with your MA RSI and I was wondering how I go about changing the thickness of the MA and RSI.

    I was able to figure out how to change my lines but not the MA and RSI...a 2 would be great.

    Thanks.

    Bruce

  • #2
    MA RSI

    Sorry, the file didn't show up.

    Bruce

    =========
    /************************************************** *******
    Alexis C. Montenegro © May 2003
    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 vRSI = null;
    var vMAofRSI = null;

    function preMain() {
    setStudyTitle("MAofRSI");
    setCursorLabelName("RSI", 0);
    setDefaultBarFgColor(Color.yellow, 0);
    setCursorLabelName("MAofRSI", 1);
    setDefaultBarFgColor(Color.white, 1);
    setStudyMin(0);
    setStudyMax(100);
    checkVersion(2,"http://share.esignal.com/ContentRoot/ACM%20Test/Formulas/MAofRSI.efs"); //Comment this line out if modifying the code

    var fp1 = new FunctionParameter("RSILength", FunctionParameter.NUMBER);
    fp1.setLowerLimit(1);
    fp1.setDefault(6); //Edit this value to set a new default

    var fp2 = new FunctionParameter("RSISource", FunctionParameter.STRING);
    fp2.setName("RSISource");
    fp2.addOption("Close");
    fp2.addOption("High");
    fp2.addOption("Low");
    fp2.addOption("Open");
    fp2.addOption("HL/2");
    fp2.addOption("HLC/3");
    fp2.addOption("OHLC/4");
    fp2.setDefault("HLC/3"); //Edit this value to set a new default

    var fp3 = new FunctionParameter("MALength", FunctionParameter.NUMBER);
    fp3.setLowerLimit(1);
    fp3.setDefault(9); //Edit this value to set a new default

    var fp4 = new FunctionParameter("MAType", FunctionParameter.STRING);
    fp4.setName("MAType");
    fp4.addOption("MAStudy.SIMPLE");
    fp4.addOption("MAStudy.EXPONENTIAL");
    fp4.addOption("MAStudy.WEIGHTED");
    fp4.addOption("MAStudy.VOLUMEWEIGHTED");
    fp4.setDefault("MAStudy.SIMPLE"); //Edit this value to set a new default

    var fp5 = new FunctionParameter("Upper", FunctionParameter.NUMBER);
    fp5.setDefault(85); //Edit this value to set a new default

    var fp6 = new FunctionParameter("Lower", FunctionParameter.NUMBER);
    fp6.setDefault(15); //Edit this value to set a new default

    }

    function main(RSILength, RSISource, MALength, MAType, Upper, Lower) {

    if (vRSI == null) vRSI = new RSIStudy(RSILength, RSISource);
    if (vMAofRSI == null) vMAofRSI = new MAStudy(MALength, 0, vRSI, MAStudy.MA, eval(MAType));
    addBand( Upper, PS_SOLID, 2, Color.red,2);
    addBand( Lower, PS_SOLID, 2, Color.lime,3);

    /******************************************
    Insert your code following this text block
    Use vRSI.getValue(RSIStudy.RSI) and
    vMAofRSI.getValue(MAStudy.MA) for your code
    *******************************************/



    return new Array ( vRSI.getValue(RSIStudy.RSI),
    vMAofRSI.getValue(MAStudy.MA));
    Attached Files

    Comment


    • #3
      Bruce
      Open the efs with the Editor and insert the following two lines of code in the preMain section after setDefaultBarFgColor(Color.white, 1);

      setDefaultBarThickness(2,0);
      setDefaultBarThickness(2,1);

      The first value in parenthesis is what determines the thickness, the second assigns the command to the specific plot.

      Also comment out or delete the line that has checkVersion(2,"http://share.esignal.com/ContentRoot..etc) as this uses the EFS Auto Update function. To comment out a line precede it with a //.
      Alex

      Comment


      • #4
        Thanks

        Alex: it worked perfectly.....thanks so much.

        Bruce

        Comment

        Working...
        X