Announcement

Collapse
No announcement yet.

How to convert rsi() to /library/RSIStandard.efs

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

  • How to convert rsi() to /library/RSIStandard.efs

    Hi,

    I trying to use the function /library/RSIStandard.efs instead of the regular rsi(), how do I convert the following equations to use :


    var xStudyFast = rsi(14,inv(1));
    var xStudySlow = rsi(14,inv(3));
    var xStudyXSlow = rsi(14,inv(15));

    to use something like :

    vValue = efsExternal("/library/RSIStandard.efs", nInputLength);


    Also how can one pass the stock symbol into the equation ?

    Thanks in advance,

    Binh

  • #2
    Binh
    In order to run an external efs in the context of an interval or symbol that is being passed to it you need to use either the inv() or sym() function which need to be the last parameter of the efsExternal() call (see the respective links for the syntax and description of these functions). For example
    var myVar = efsExternal("path_to_efs/name_of_efs.efs", param1, param2, ..., inv("myInterval"))
    Replace inv() wih sym() if you want to pass a symbol or symbol and interval (see the examples at the links above)
    Alex

    Comment


    • #3
      Hello Alexis,

      I still don't know how to pass the sym() and inv() to the efsExternal function.

      I want to do something like this:

      vValue = efsExternal(sym(VLO),inv(1),"/library/RSIStandard.efs", 14);


      Can you help me developing this code ?

      Thanks,

      Binh

      Comment


      • #4
        Binh
        There are a couple of errors in the line of code you posted.
        vValue = efsExternal(sym(VLO),inv(1),"/library/RSIStandard.efs", 14);
        The first one is the position of the sym() series. As I indicated in my previous reply the inv() or sym() series need to be the last parameter if they are to control the context in which an external efs is going to run.
        The second error is in the use of the sym() and inv() functions. If you want to pass a symbol and interval you only need the sym() function using the symbol and interval parameters as a single string separated by a comma eg sym("mySymbol, myInterval"). Here is the same line of code corrected for these errors
        vValue = efsExternal("/library/RSIStandard.efs", 14, sym("VLO, 1"));
        You can find a complete series of examples on how to use the inv() and sym() functions at the links I included in my previous reply
        Alex

        Comment

        Working...
        X