Hi, i always get the message:
EMA1005.efs line 68 Reference Error. Action is not defined
Line 68 is
function onAction1() {
if (vLastAlert != 1) Actions.addToList(getSymbol(), "", Color.RGB(0,0,0), Color.RGB(195,0,0));
if (vLastAlert != 1) Actions.playSound("E:\\Programme\\eSignal\\Sounds\ \Bullet.wav");
if (vLastAlert != 1) Actions.drawShapeRelative(0, low(), Shape.UPARROW, "", Color.RGB(155,0,0), Shape.BOTTOM);
vLastAlert = 1;
I think, the 3 actions are correctly defined?
thanks
the complet code:
{EFSWizard_Description
//
// This formula was generated by the Alert Wizard
//
//}}EFSWizard_Description
//{{EFSWizard_Declarations
var vEMA20 = new MAStudy(20, 0, "Close", MAStudy.EXPONENTIAL);
var vADXDM = new ADXDMStudy(14);
var vLastAlert = -1;
//}}EFSWizard_Declarations
function preMain() {
/**
* This function is called only once, before any of the bars are loaded.
* Place any study or EFS configuration commands here.
*/
//{{EFSWizard_PreMain
setPriceStudy(true);
setStudyTitle("EMA1005");
//}}EFSWizard_PreMain
}
function main() {
/**
* The main() function is called once per bar on all previous bars, once per
* each incoming completed bar, and if you don't have 'setComputeOnClose(true)'
* in your preMain(), it is also called on every tick.
*/
//{{EFSWizard_Expressions
//{{EFSWizard_Expression_1
if (
vEMA20.getValue(MAStudy.MA) < close() &&
vADXDM.getValue(ADXDMStudy.ADX) > 30
) onAction1()
//}}EFSWizard_Expression_1
//{{EFSWizard_Expression_2
else if (
vEMA20.getValue(MAStudy.MA) >= close() &&
vADXDM.getValue(ADXDMStudy.ADX) > 30
) onAction2();
//}}EFSWizard_Expression_2
//}}EFSWizard_Expressions
//{{EFSWizard_Return
return null;
//}}EFSWizard_Return
}
function postMain() {
/**
* The postMain() function is called only once, when the EFS is no longer used for
* the current symbol (ie, symbol change, chart closing, or application shutdown).
*/
}
//{{EFSWizard_Actions
//{{EFSWizard_Action_1
function onAction1() {
if (vLastAlert != 1) Actions.addToList(getSymbol(), "", Color.RGB(0,0,0), Color.RGB(195,0,0));
if (vLastAlert != 1) Actions.playSound("E:\\Programme\\eSignal\\Sounds\ \Bullet.wav");
if (vLastAlert != 1) Actions.drawShapeRelative(0, low(), Shape.UPARROW, "", Color.RGB(155,0,0), Shape.BOTTOM);
vLastAlert = 1;
}
//}}EFSWizard_Action_1
//{{EFSWizard_Action_2
function onAction2() {
if (vLastAlert != 2) Actions.addToList(getSymbol(), "", Color.RGB(0,255,0), Color.RGB(0,0,255));
if (vLastAlert != 2) Actions.drawShapeRelative(0, low(), Shape.DOWNARROW, "", Color.RGB(155,0,0), Shape.TOP);
if (vLastAlert != 2) Actions.playSound("E:\\Programme\\eSignal\\Sounds\ \Sipping.wav");
vLastAlert = 2;
}
//}}EFSWizard_Action_2
//}}EFSWizard_Actions
EMA1005.efs line 68 Reference Error. Action is not defined
Line 68 is
function onAction1() {
if (vLastAlert != 1) Actions.addToList(getSymbol(), "", Color.RGB(0,0,0), Color.RGB(195,0,0));
if (vLastAlert != 1) Actions.playSound("E:\\Programme\\eSignal\\Sounds\ \Bullet.wav");
if (vLastAlert != 1) Actions.drawShapeRelative(0, low(), Shape.UPARROW, "", Color.RGB(155,0,0), Shape.BOTTOM);
vLastAlert = 1;
I think, the 3 actions are correctly defined?
thanks
the complet code:
{EFSWizard_Description
//
// This formula was generated by the Alert Wizard
//
//}}EFSWizard_Description
//{{EFSWizard_Declarations
var vEMA20 = new MAStudy(20, 0, "Close", MAStudy.EXPONENTIAL);
var vADXDM = new ADXDMStudy(14);
var vLastAlert = -1;
//}}EFSWizard_Declarations
function preMain() {
/**
* This function is called only once, before any of the bars are loaded.
* Place any study or EFS configuration commands here.
*/
//{{EFSWizard_PreMain
setPriceStudy(true);
setStudyTitle("EMA1005");
//}}EFSWizard_PreMain
}
function main() {
/**
* The main() function is called once per bar on all previous bars, once per
* each incoming completed bar, and if you don't have 'setComputeOnClose(true)'
* in your preMain(), it is also called on every tick.
*/
//{{EFSWizard_Expressions
//{{EFSWizard_Expression_1
if (
vEMA20.getValue(MAStudy.MA) < close() &&
vADXDM.getValue(ADXDMStudy.ADX) > 30
) onAction1()
//}}EFSWizard_Expression_1
//{{EFSWizard_Expression_2
else if (
vEMA20.getValue(MAStudy.MA) >= close() &&
vADXDM.getValue(ADXDMStudy.ADX) > 30
) onAction2();
//}}EFSWizard_Expression_2
//}}EFSWizard_Expressions
//{{EFSWizard_Return
return null;
//}}EFSWizard_Return
}
function postMain() {
/**
* The postMain() function is called only once, when the EFS is no longer used for
* the current symbol (ie, symbol change, chart closing, or application shutdown).
*/
}
//{{EFSWizard_Actions
//{{EFSWizard_Action_1
function onAction1() {
if (vLastAlert != 1) Actions.addToList(getSymbol(), "", Color.RGB(0,0,0), Color.RGB(195,0,0));
if (vLastAlert != 1) Actions.playSound("E:\\Programme\\eSignal\\Sounds\ \Bullet.wav");
if (vLastAlert != 1) Actions.drawShapeRelative(0, low(), Shape.UPARROW, "", Color.RGB(155,0,0), Shape.BOTTOM);
vLastAlert = 1;
}
//}}EFSWizard_Action_1
//{{EFSWizard_Action_2
function onAction2() {
if (vLastAlert != 2) Actions.addToList(getSymbol(), "", Color.RGB(0,255,0), Color.RGB(0,0,255));
if (vLastAlert != 2) Actions.drawShapeRelative(0, low(), Shape.DOWNARROW, "", Color.RGB(155,0,0), Shape.TOP);
if (vLastAlert != 2) Actions.playSound("E:\\Programme\\eSignal\\Sounds\ \Sipping.wav");
vLastAlert = 2;
}
//}}EFSWizard_Action_2
//}}EFSWizard_Actions
Comment