Announcement

Collapse
No announcement yet.

RSIColorLineBar.efs question

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

  • RSIColorLineBar.efs question

    I tried to use the RSIColorLineBar.efs from the Helpers Directory, but whether I left the length at the conventional 14 periods, or changed it to 8 periods (my preference), I could not get the RSI curve created by this efs to match the basic RSI study.

    Any idea why these curves do not match? Does "/library/RSIStandard.efs" calculate a different RSI?

    -------------------------------------------

    Instead, I tried to merge the setBarBgcolor commands from the RSIColorLineBar.efs into the builtinRSI.efs, but could not figure out where to get vValue from. The comments say "Use vRSI.getValue(RSIStudy.RSI) for your code", but how? Any help with this would be appreciated.

    Regards
    shaeffer

  • #2
    Hello Shaeffer,

    The RSI Study in the Basic Studies menu uses and exponential moving average calculation. For comparison, use \Library\RSIEnhanced.efs.

    The RSIColorLineBar.efs uses the \Library\RSIStandard.efs, which is based on a simple moving average calculation.

    If you want, you can change the RSIColorLineBar.efs to use the RSIEnhanced.efs instead.
    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
      Originally posted by JasonK

      If you want, you can change the RSIColorLineBar.efs to use the RSIEnhanced.efs instead.
      I did the above, and it worked. Thanks Jason.

      I can readily see how the last grouping of commands in the above efs controls the colors. As a learning experience (since I tried and failed), if I copied those commands into the builtinRSI.efs, how would I get the builtinRSI.efs to recognize vValue?

      Regards
      shaeffer

      Comment


      • #4
        Hello Shaeffer,

        The vValue variable needs to be instantiated with the var keyword and have the value of vValue set to vRSI.getValue(RSIStudy.RSI). Change the return statement in the builtinRSI.efs and add the following code.

        PHP Code:
        var vValue vRSI.getValue(RSIStudy.RSI);
        if (
        vValue == null) return;

        if(
        vValue >= 70) {
            
        setBarStyle(PS_SOLID);
            
        setBarThickness(2);
            
        setBarFgColor(Color.black);
            
        setBarBgColor(Color.red);
        } else if(
        vValue <= 30) {
            
        setBarStyle(PS_SOLID);
            
        setBarThickness(2);
            
        setBarFgColor(Color.black);
            
        setBarBgColor(Color.lime);
        }

        return (
        vValue); 
        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