Announcement

Collapse
No announcement yet.

with (lib)

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • with (lib)

    Alex (or anyone who knows),

    I am trying to access values in amSineWeightedMA.efs.

    Because the efs is really a call to an encrypted library I am trying to referece the series that the library function returns but I am having no luck and have tried millions of variations on the theme. I really just want to be able to compare the current (zero index) value. Here is the most recent attempt, and I'd be very greatful for some help...:


    var amLib = addLibrary("amStudies.efsLib");
    var bInit = false;
    var xSWMA = null;
    var Symbol = null;
    var Interval = null;

    function main() {
    with( amLib )
    {
    if(Symbol == null) Symbol = getSymbol();
    if(Interval == null) Interval = getInterval();
    var vSymbol = Symbol+","+Interval;



    xSWMA = getSeries(amSWMA(5,close(sym(vSymbol))));
    }
    debugClear();
    debugPrint("*");
    debugPrint(vSymbol);
    debugPrint(xSWMA);
    }

  • #2
    Hello mitboy,

    The problem is your usage of getSeries(), which is invalid. That function is used to convert the return value(s) of a data series back into a Series Object for synchronized plotting or to extract a specific series from a Series Object's returned array of data series.

    The modification below will resolve the problem.



    If you then want to access the values of this series use the .getValue(nIndex) method.

    xSWMA.getValue(0);
    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
      Thank you Jason, you were dead right - thanks for the assistance!

      Comment


      • #4
        You're most welcome.
        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