Hi folks,
I would like to have the following efs to sound and display the alert just once price crosses the threshold.
/************************************************** ***************
Provided By : eSignal. (c) Copyright 2003
************************************************** ***************/
function preMain() {
setStudyTitle(" Tick Extremes ");
setCursorLabelName("TICK C", 0);
setPlotType(PLOTTYPE_LINE, 0);
setStudyMax(1500);
setStudyMin(-1500);
}
var vColor = Color.white;
var vLoaded = false;
function main(nTickHigh, nTickLow, nNumOfBars) {
if (nTickHigh == null) nTickHigh = 1000;
if (nTickLow == null) nTickLow = -1000;
if (vLoaded == false) {
addBand(nTickHigh, PS_SOLID, 1, Color.yellow, "top");
addBand(0, PS_SOLID, 1, Color.grey, "zero");
addBand(nTickLow, PS_SOLID, 1, Color.yellow, "bottom");
vLoaded = true;
}
var c = close(0, 1, "$tick")*1;
if (c == null) return;
vColor = Color.white;
if (c > nTickHigh) {
vColor = Color.lime;
Alert.playSound("ding.wav");
Alert.addToList(getSymbol()+" "+getInterval(),"tick Up",Color.white,Color.lime);
}
if (c < nTickLow) {
vColor = Color.red;
Alert.playSound("ding.wav");
Alert.addToList(getSymbol()+" "+getInterval(),"tick down",Color.white,Color.red);
}
setBarFgColor(vColor, 0);
return c;
}
Please advice.
Thanks,
Matt
I would like to have the following efs to sound and display the alert just once price crosses the threshold.
/************************************************** ***************
Provided By : eSignal. (c) Copyright 2003
************************************************** ***************/
function preMain() {
setStudyTitle(" Tick Extremes ");
setCursorLabelName("TICK C", 0);
setPlotType(PLOTTYPE_LINE, 0);
setStudyMax(1500);
setStudyMin(-1500);
}
var vColor = Color.white;
var vLoaded = false;
function main(nTickHigh, nTickLow, nNumOfBars) {
if (nTickHigh == null) nTickHigh = 1000;
if (nTickLow == null) nTickLow = -1000;
if (vLoaded == false) {
addBand(nTickHigh, PS_SOLID, 1, Color.yellow, "top");
addBand(0, PS_SOLID, 1, Color.grey, "zero");
addBand(nTickLow, PS_SOLID, 1, Color.yellow, "bottom");
vLoaded = true;
}
var c = close(0, 1, "$tick")*1;
if (c == null) return;
vColor = Color.white;
if (c > nTickHigh) {
vColor = Color.lime;
Alert.playSound("ding.wav");
Alert.addToList(getSymbol()+" "+getInterval(),"tick Up",Color.white,Color.lime);
}
if (c < nTickLow) {
vColor = Color.red;
Alert.playSound("ding.wav");
Alert.addToList(getSymbol()+" "+getInterval(),"tick down",Color.white,Color.red);
}
setBarFgColor(vColor, 0);
return c;
}
Please advice.
Thanks,
Matt
Comment