Announcement

Collapse
No announcement yet.

Using sym() to retrieve alternate symbol data always returns null - help please!

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

  • Using sym() to retrieve alternate symbol data always returns null - help please!

    I've searched the forums and knowledgebase and haven't found anything about this problem.

    I am running an EFS script attached to a 5-minute chart with symbol "IN A0" (the S&P 500 cash index). It is using a custom time template fixed to 20,000 bars.

    In that script, I need to retrieve values for a few other symbols as well. I am using the following code:

    var Vol = volume(0);
    var Volx240 = volume(inv(240), 0);
    var VolxD = volume(inv("D"), 0);
    var VIX = open(sym("$VIX"), 0);
    var ADV = open(sym("$ADV"), 0);
    var CPCE = open(sym("$PCE-ST"), 0);

    When this runs, Vol is almost always 60, and all the other variables (Volx240, VolxD, VIX, ADV, CPCE) are ALWAYS null, every single bar out of the 20,000.

    I have set the time template to a fixed number of 20,000 bars. I also called setIntervalsBackfill(true) in preMain().

    It seems pretty clear that the volume data is bogus, and eSignal just isn't loading any data at all for the other symbols ($VIX, $ADV, $PCE-ST) or for volume on the other intervals (240, D).

    It's not an entitlements problem - I regularly run charts with all these symbols. They just aren't loading in EFS for some reason.

    Please help me figure out what is going wrong here...

    Thanks...

  • #2
    spudthorpe
    The syntax you used in all the open() and volume() [except in the first instance] functions is incorrect [should be open(0, sym(...)) etc]
    See the code examples provided in this and this article in the EFS KnowledgeBase
    Alex


    Originally posted by spudthorpe View Post
    I've searched the forums and knowledgebase and haven't found anything about this problem.

    I am running an EFS script attached to a 5-minute chart with symbol "IN A0" (the S&P 500 cash index). It is using a custom time template fixed to 20,000 bars.

    In that script, I need to retrieve values for a few other symbols as well. I am using the following code:

    var Vol = volume(0);
    var Volx240 = volume(inv(240), 0);
    var VolxD = volume(inv("D"), 0);
    var VIX = open(sym("$VIX"), 0);
    var ADV = open(sym("$ADV"), 0);
    var CPCE = open(sym("$PCE-ST"), 0);

    When this runs, Vol is almost always 60, and all the other variables (Volx240, VolxD, VIX, ADV, CPCE) are ALWAYS null, every single bar out of the 20,000.

    I have set the time template to a fixed number of 20,000 bars. I also called setIntervalsBackfill(true) in preMain().

    It seems pretty clear that the volume data is bogus, and eSignal just isn't loading any data at all for the other symbols ($VIX, $ADV, $PCE-ST) or for volume on the other intervals (240, D).

    It's not an entitlements problem - I regularly run charts with all these symbols. They just aren't loading in EFS for some reason.

    Please help me figure out what is going wrong here...

    Thanks...

    Comment


    • #3
      Looks like you're right, that fixed the problem.

      I have to wonder why the syntax is backwards in open() and volume() as compared to all the built-in study functions. (In those functions, the bar index comes last, after sym()). It hadn't even occurred to me that these functions would be designed with the opposite parameter order.

      Thanks for the help!

      Comment


      • #4
        spudthorpe
        It was done that way when efs2 was introduced to maintain backwards compatibility with the syntax - and to a certain extent functionality - of the legacy [aka efs1] functions with the same name [ie open() high(), low(), close(), volume() and oi()]
        Alex


        Originally posted by spudthorpe View Post
        Looks like you're right, that fixed the problem.

        I have to wonder why the syntax is backwards in open() and volume() as compared to all the built-in study functions. (In those functions, the bar index comes last, after sym()). It hadn't even occurred to me that these functions would be designed with the opposite parameter order.

        Thanks for the help!

        Comment

        Working...
        X