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);
}
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