Announcement

Collapse
No announcement yet.

similar to RSIStudy object

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

  • similar to RSIStudy object

    Hi Alex,

    I'm looking at your builtinRSI.efs written on May 2003. It looks very neat, and I particularly like the way the input parameters are set, such as fp1, fp2, fp3, and fp4. It's also interesting to see how you use the fp2.addOptions.

    I would like to write something like the builtinRSI.efs, where I can specify the options and limits of the parameters.

    But I don't understand how you can specify addOption("HLC/3"), unless the method RSIStudy(Length, Source) takes care of all the possible combination of Sources.

    Also, in the main(), you have
    if (vRSI == null) vRSI = new RSIStudy(Length, Source);
    which, as I undstand, creates an object vRSI, based on the class RSIStudy with parameters Length and Source.

    I suppose RSIStudy.RSI call the method RSI. Is that correct?. So, how can I write my own object and methods like the RSIStudy, so I can do something like:

    return vmyRSI.getValue(myRSIStudy.RSI);

    Would it be possible to look inside the class RSIStudy?

    William

  • #2
    Hello William,

    The RSIStudy() object is the old EFS1 study object. You should use the new EFS2 rsi() series object.

    If you are just trying to create a study on study series by passing other studies to the RSI study as the source, see this thread for some code examples.

    The base code for the rsi() series is not publicly available. However, if you are just looking for the calculation, take a look at \Formulas\Library\RSIEnhanced.efs and RSIStandard.efs.

    If you are trying to make a modified series based on the RSI calculation, you use the formula logic from the above mentioned formulas as the starting point for creating your customized calculation. These formula examples turn the calculation into a series so that you can use the .getValue() method on it by passing a user-defined function to the efsInternal() series function. The first link I referenced in this post also has a code example of how to use efsInternal().
    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
      For some reason, the 1st and 3rd link were refused when I click on them.

      William

      Comment


      • #4
        William
        That is because those links point to articles in the KnowledgeBase which is currently down for maintenance (see this notice)
        Alex

        Comment


        • #5
          Jason,

          The stuff you point to me in the links are really helpful. Thank you.

          I have here a test.efs. It does what I wanted now. The EFS 2 saves a lot of codes.

          However, I do have more questions.

          1. Line 11, I have a error: TypeError: myVarCurrent has no properties No sure what that means. I'm following what the spec says about .tof

          2. In my earlier question within this thread, regarding EFS 1's way of specifying input parameters through fp1, fp2, fp3, and fp4 in builtinRSI.efs. I'm wondering how I can specify input parameters with limits, and for Source to be OC/2?

          William
          Attached Files

          Comment


          • #6
            William
            1. You need to do a null check on the value before applying to the .toFixed() method eg
            if(myVarCurrent==null) return;
            Note that in the debugPrintln you have myVarCurrent.tofixed(4) instead of myVarCurrent.toFixed(4)
            2. To set the limits in the FunctionParameter Object you can use the setUpperLimit() and setLowerLimit() methods. See this article in the EFS KnowledgeBase on the FunctionParameter Object
            Alex

            Comment


            • #7
              William

              I'm wondering how I can specify ...for Source to be OC/2?
              OC/2 is not a readily avalaible prices series so you would need to calculate it in a separate function (or efs) and then call it from main using the efsInternal() (or efsExternal()) function. That creates the series object that you can then use as a source for your study.
              For a practical example of how to implement this see the QCharts_Keltner.efs written by Jason and posted in this thread
              Alex

              Comment


              • #8
                Thanks, Alex.

                I must EFS2 is much more flexible than EasyLanguage.

                Good Job!

                Comment

                Working...
                X