I try to make an efs for an alert when a MA crosses the price but with interval inv(). This is what I wrote but when I put the interval on then the application crashes.
----------
.................
I have the latest esignal 7.9.1.
Any Ideas
Elias
----------
PHP Code:
var vEMA34;
var vLastAlert = -1;
function preMain() {
setPriceStudy(true);
setStudyTitle("");
setCursorLabelName("?", 0);
setDefaultBarStyle(PS_SOLID, 0);
setDefaultBarFgColor(Color.red, 0);
setDefaultBarThickness(1, 0);
setPlotType(PLOTTYPE_LINE, 0);
}
function main() {
vEMA34 = new MAStudy(34, 0, "Close", MAStudy.EXPONENTIAL, inv(1));
if (close() > vEMA34.getValue(MAStudy.MA))
onAction1()
else if (close() < vEMA34.getValue(MAStudy.MA))
onAction2();
return vEMA34.getValue(MAStudy.MA);
}
function postMain() {
}
function onAction1() {
if (vLastAlert != 1) Alert.playSound("C:\\Program Files\\eSignal\\Sounds\\Alarm.wav");
if (vLastAlert != 1) Alert.addToList(getSymbol(), "34EMA-Cross UP", Color.black, Color.green);
vLastAlert = 1;
}
function onAction2() {
if (vLastAlert != 2) Alert.playSound("C:\\Program Files\\eSignal\\Sounds\\Alarm.wav");
if (vLastAlert != 2) Alert.addToList(getSymbol(), "34EMA-Cross Down", Color.red, Color.red);
vLastAlert = 2;
}
I have the latest esignal 7.9.1.
Any Ideas
Elias
Comment