I wish to add an audio alert to the MACD crossover. Is it possible this formula exist?
Announcement
Collapse
No announcement yet.
Macd Crossover
Collapse
X
-
In the file library, there is an EFS script called MACD X-over.efs. In the section of the code (reproduced below) add the line Alert.playSound(filename);
if (vAlert == false) {
if (vMACD1 < vSignal1 && vMACD >= vSignal) { // crossing up
vAlert = true;
AlertCntr += 1;
drawShapeRelative(0, vSignal, Shape.UPARROW, null, Color.RGB(60,179,113), Image.TOP | Image.ONTOP, "Alert" + AlertCntr);
Alert.playSound("ding.wav"); // Play sound file
}
if (vMACD1 > vSignal1 && vMACD <= vSignal) { // crossing down
vAlert = true;
AlertCntr += 1;
drawShapeRelative(0, vSignal, Shape.DOWNARROW, null, Color.RGB(255,104,32), Image.BOTTOM | Image.ONTOP, "Alert" + AlertCntr);
Alert.playSound("dong.wav"); // Play sound file
}
} else {
if ((vMACD1 < vSignal1 && vMACD < vSignal) || (vMACD1 > vSignal1 && vMACD > vSignal)) {
vAlert = false;
removeShape("Alert" + AlertCntr);
}
}Last edited by Highfield; 08-17-2003, 08:05 AM.
Comment