Announcement

Collapse
No announcement yet.

Limit 3 Symbols Per Formula

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

  • Limit 3 Symbols Per Formula

    Hi,

    I modified the OHLC function provided by eSignal to get the previous day close for diferent symbols (see below).
    I am calling this function from an other formula. Altgough there are two (2) calls (NQ/NDX or ES/SPX), I get the following message for the line 78 in the called funtion:
    " Function..., line 78: The Symbol Lymit (3) for a formula has been exceeded"

    Can anybody explain why and how can be corrected?
    Thank you.
    Mihai

    ************************
    CALLED FUNCTION
    ************************
    function main(sBarItem, vSymbol) {
    if(sBarItem == null) {return;}
    if(vSymbol == null) {return;}
    ..............
    Line 78
    vAbsTime = getPreviousTradingDay(vBarTime, vSymbol);
    .....................

    ********************
    My idicator
    ********************
    ...............
    if (
    SYMBOL.length <= 3 || SYMBOL.substr(0,4) == "YM M" || SYMBOL.substr(0,4) == "ES M"
    ) {
    TRIN = close(0, 1, "$TRIN");
    IDX_SYMBOL = "$SPX";
    FUT_SYMBOL = "ES "+CONTRACT_MONTH;
    }
    else {
    TRIN = close(0, 1, "$TRINQ");
    IDX_SYMBOL = "$NDX";
    FUT_SYMBOL = "NQ "+CONTRACT_MONTH;
    }

    var CASH_IDX = close(0, 1, IDX_SYMBOL);
    var FUTURES = close(0, 1, FUT_SYMBOL);
    var PREV_DAY_CLOSE_IDX = call("MyFunctions/MyPrevOHLC.efs", "Close", IDX_SYMBOL);
    var PREV_DAY_CLOSE_FUT = call("MyFunctions/MyPrevOHLC.efs", "Close", FUT_SYMBOL);
    var PERCENT_MOVE_CASH = 100*(CASH_IDX - PREV_DAY_CLOSE_IDX)/PREV_DAY_CLOSE_IDX;
    var PERCENT_MOVE_FUT = 100*(FUTURES - PREV_DAY_CLOSE_FUT)/PREV_DAY_CLOSE_FUT;
    .....................
    Mihai Buta

  • #2
    Mihai
    EFS has a 3 symbol limit. However this has been raised to 5 in the latest beta.
    Alex

    Comment


    • #3
      I understand the present limitation.

      However, if you read the code, I call the function only twice, based on the IF condition in my indicator.

      Why is considering ALL the variants of the IF function and considers that I am calling the function four times?
      This is not correct and should not happen.

      Thank you,
      Mihai
      Mihai Buta

      Comment


      • #4
        You don't really give enough code for me to debug this, I would put in debug statements if I were you to verify that the symbol you think you are using in the called function is really the symbol you think it is.

        G
        Garth

        Comment


        • #5
          Hi Spiker and thank you for your help.

          I posted the relevant portion of my study, where I compile and select the symbols.
          They should be: $SPX and ES M3, or $NDX and NQ M3.
          You can check if is done right.

          From the OHLC function, I provided the line that generates the error. The entire efs is the same as the "getPrevOHLC.efs" in the OHLC directory, where I made the symbol a parameter. Tha is all.

          The point is that, see in my code, I call the function only twice (for the pair of symbols generated), but is gives me the error.
          If I delete any branch of the "if" I get no error and it works fine.

          Thanks,
          Mihai
          Mihai Buta

          Comment

          Working...
          X