Announcement

Collapse
No announcement yet.

addToList not working

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

  • addToList not working

    I am not able to get addToList to work even with adding the suggested isLastBarOnChart() modification. Any ideas?

    I have made a modification to the Kelter_ATR_Bands.efs, by adding a notification element. I have added both a playSound and addToList notice. The playSound alert seems to work fine but the addToList is not working.

    One other variable that might be influencing the results is that I am running this EFS on a candlestick chart that uses range (0.05R) instead of time - such as 1 minute. Could that be driving the AddToList failure to notify?

    I know that AddToList is working since I have other charts in the window that include AddToList notices (though these are off of time interval charts) which are working fine.

    Here is the code - notification adjustments are highlighted in BOLD / BLUE. It would be very helpful if anyone knows how to solve this problem. Thank you.

    function Calc_KeltnerBand(Length, ATRMult) {
    var nResUp = 0;
    var nResDn = 0;
    var nMA = 0;
    var nATR = 0;
    if (bSecondInit == false) {
    xMA = sma(Length);
    xATR = atr(Length);
    bSecondInit = true;
    }
    nMA = xMA.getValue(0);
    nATR = xATR.getValue(0);
    if (nMA == null || nATR == null) return;
    nResUp = nMA + ATRMult * nATR;
    nResDn = nMA - ATRMult * nATR;
    if ( close() >= nResUp || close() <= nResDn && isLastBarOnChart()==true ) {
    var symb = getSymbol();
    Alert.addToList( symb, "Keltner Extreme", Color.green, Color.black );
    Alert.playSound("Buzz.wav");
    }

    return new Array(nResUp, nResDn);
    }

  • #2
    Re: addToList not working

    aagoodfella
    Based on what I am seeing it appears that version 11 is not executing Alert.addToList() if this is called from within a function [or sub-function thereof] that is called by efsInternal() as is the case with the script you are referencing
    You may want to report the bug to eSignal using the Report A Bug link available under Support in the main menu of the application.
    In the mean time you can work around this by moving the lines highlighted in blue in your code snippet to the main function and inserting them just below the line
    if (nKU == null || nKL == null) return;
    Once you have done that replace nResUp and nResDn in your conditional statement with nKU and nKL respectively
    Alex


    Originally posted by aagoodfella
    I am not able to get addToList to work even with adding the suggested isLastBarOnChart() modification. Any ideas?

    I have made a modification to the Kelter_ATR_Bands.efs, by adding a notification element. I have added both a playSound and addToList notice. The playSound alert seems to work fine but the addToList is not working.

    One other variable that might be influencing the results is that I am running this EFS on a candlestick chart that uses range (0.05R) instead of time - such as 1 minute. Could that be driving the AddToList failure to notify?

    I know that AddToList is working since I have other charts in the window that include AddToList notices (though these are off of time interval charts) which are working fine.

    Here is the code - notification adjustments are highlighted in BOLD / BLUE. It would be very helpful if anyone knows how to solve this problem. Thank you.

    function Calc_KeltnerBand(Length, ATRMult) {
    var nResUp = 0;
    var nResDn = 0;
    var nMA = 0;
    var nATR = 0;
    if (bSecondInit == false) {
    xMA = sma(Length);
    xATR = atr(Length);
    bSecondInit = true;
    }
    nMA = xMA.getValue(0);
    nATR = xATR.getValue(0);
    if (nMA == null || nATR == null) return;
    nResUp = nMA + ATRMult * nATR;
    nResDn = nMA - ATRMult * nATR;
    if ( close() >= nResUp || close() <= nResDn && isLastBarOnChart()==true ) {
    var symb = getSymbol();
    Alert.addToList( symb, "Keltner Extreme", Color.green, Color.black );
    Alert.playSound("Buzz.wav");
    }

    return new Array(nResUp, nResDn);
    }

    Comment


    • #3
      Thank you Alexis. I have implemented your coding suggestions and it works fine. Further, I reported to eSignal about the potential EFS bug. Thanks again for your help.

      Comment


      • #4
        aagoodfella
        You are welcome
        Alex


        Originally posted by aagoodfella
        Thank you Alexis. I have implemented your coding suggestions and it works fine. Further, I reported to eSignal about the potential EFS bug. Thanks again for your help.

        Comment

        Working...
        X