Announcement

Collapse
No announcement yet.

how to color bars

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

  • how to color bars

    I made this efs in wizard and am trying to color bars. Green for higher rsi and red for lower rsi bar. I put it main function but it keeps oming up as error. Any help on where to put comand would be helpful .

    Steven

    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, 1, Color.black,2);
    addBand( Lower, PS_SOLID, 1, Color.black,3);

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

    if(vRSI.getValue(RSIStudy.RSI)>vRSI.getValue(RSISt udy.RSI,-1))
    setBarFgColor(Color.green);
    if(vRSI.getValue(RSIStudy.RSI)<vRSI.getValue(RSISt udy.RSI,-1))
    setBarFgColor(Color.red);
    Attached Files

  • #2
    Hello Steven,

    After modifying your formula to color the bars with setBarFgColor(), open the formula in the EFS Editor and make sure line 12 has a "new" constructor in front of MAStudy(....). It should look like this:

    var vEMA10_of_vRSI14 = new MAStudy(10, 0, vRSI14, RSIStudy.RSI, MAStudy.EXPONENTIAL);
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      hello Jason,

      I have been trying to get this efs going but still cant figure it out . Is it possible for you to fix the formula so it will color the bars. I have put in the commands on line 81 but it wont color the bars. i will look on your formula to see what i am doing wrong . Hope you can help .

      thank you
      Steven
      Attached Files

      Comment


      • #4
        Hello Steven,

        You are using setBarBgColor in some instances, which colors the background. If you want to color the histogram bars use setBarFgColor(). You can color both the background and histogram bars in the same action if need be. Simply click on Add Line in your corresponding conditional Sets and add the other function.
        Jason K.
        Project Manager
        eSignal - an Interactive Data company

        EFS KnowledgeBase
        JavaScript for EFS Video Series
        EFS Beginner Tutorial Series
        EFS Glossary
        Custom EFS Development Policy

        New User Orientation

        Comment

        Working...
        X