Announcement

Collapse
No announcement yet.

Getting Keltner values

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

  • Getting Keltner values

    I am calling the Keltner EFS Library study with the following:

    function preMain()
    {
    setPriceStudy(true);
    setStudyTitle("Keltner");
    setCursorLabelName("K");
    }

    function main()
    {

    var Keltner = call("Keltner.efs");

    debugClear();
    debugPrintln(" Keltner: " + Keltner);

    }

    When I load this study, the Keltner array with its three values is returned to the Formula Output Window as:

    Keltner: 659.233333333332,658.6833333333333,658.12333333333 33

    If I change the debugPrintln to display only the first value of the Keltner array as follows:

    function preMain()
    {
    setPriceStudy(true);
    setStudyTitle("Keltner");
    setCursorLabelName("K");
    }

    function main()
    {

    var Keltner = call("Keltner.efs");

    debugClear();
    debugPrintln(" Keltner: " + Keltner[0]);

    }

    the Formula Output Window returns:

    Type Error: Keltner has no properties

    Can someone tell me how to return only the first value of the array?

    I'm running this study in version 7.9 on a 150 tick chart for AB #F.

    Thanks
    Last edited by werosen; 08-22-2005, 11:36 PM.

  • #2
    werosen
    Run a null check on the variable Keltner before retrieving an element of that array ie if(Keltner==null) return
    Alex

    Comment

    Working...
    X