Hi,
i am having a problem with EFS. the problem is whenever a alert is issued it doesnt stop it continuously send alert until the bar is closed e.g. when i add the efs to a 5min chart and after 3min the condition are meet and alert is issued till than it ok but as price move up in the same bar it issue alert again and again until the bar is closed. Could u pls advised what to add so it doesnt issue more than 1 alert in the same bar. Below is the efs.
function preMain() {
setPriceStudy(true);
setStudyTitle("Blue Squat");
setShowCursorLabel(false);
setShowTitleParameters(false);
}
function main() {
//If current bar high is higher than previous 5 bars high
var condition1 = high(0)>Math.max(high(-1),high(-2),high(-3),high(-4),high(-5));
// If current bar close, lower than previous 1 bar close
var condition2 = close(0)<close(-1);
//if both are true, draw round colored dot at the top of current bar
if(condition1 && condition2){
drawShape( Shape.CIRCLE, AboveBar1, Color.blue);
Alert.addToList(getSymbol(), "Short" + " " + getSymbol() + " " + getInterval(), Color.red, Color.black);
Alert.playSound("Bullet.wav");
}
// If current bar low is lower than previous 5 bars low
var condition3 = low(0)<Math.min(low(-1),low(-2),low(-3),low(-4),low(-5));
// If current bar close, higher than previous 1 bar close
var condition4 = close(0)>close(-1);
//if both are true, draw round colored dot at the bottom of current bar
if(condition3 && condition4){
drawShape( Shape.CIRCLE, BelowBar1, Color.blue);
Alert.addToList(getSymbol(), "Long" + " " + getSymbol() + " " + getInterval(), Color.lime, Color.black);
Alert.playSound("Bullet.wav");
}
Thanks.
Suharwardi.
i am having a problem with EFS. the problem is whenever a alert is issued it doesnt stop it continuously send alert until the bar is closed e.g. when i add the efs to a 5min chart and after 3min the condition are meet and alert is issued till than it ok but as price move up in the same bar it issue alert again and again until the bar is closed. Could u pls advised what to add so it doesnt issue more than 1 alert in the same bar. Below is the efs.
function preMain() {
setPriceStudy(true);
setStudyTitle("Blue Squat");
setShowCursorLabel(false);
setShowTitleParameters(false);
}
function main() {
//If current bar high is higher than previous 5 bars high
var condition1 = high(0)>Math.max(high(-1),high(-2),high(-3),high(-4),high(-5));
// If current bar close, lower than previous 1 bar close
var condition2 = close(0)<close(-1);
//if both are true, draw round colored dot at the top of current bar
if(condition1 && condition2){
drawShape( Shape.CIRCLE, AboveBar1, Color.blue);
Alert.addToList(getSymbol(), "Short" + " " + getSymbol() + " " + getInterval(), Color.red, Color.black);
Alert.playSound("Bullet.wav");
}
// If current bar low is lower than previous 5 bars low
var condition3 = low(0)<Math.min(low(-1),low(-2),low(-3),low(-4),low(-5));
// If current bar close, higher than previous 1 bar close
var condition4 = close(0)>close(-1);
//if both are true, draw round colored dot at the bottom of current bar
if(condition3 && condition4){
drawShape( Shape.CIRCLE, BelowBar1, Color.blue);
Alert.addToList(getSymbol(), "Long" + " " + getSymbol() + " " + getInterval(), Color.lime, Color.black);
Alert.playSound("Bullet.wav");
}
Thanks.
Suharwardi.
Comment