Announcement

Collapse
No announcement yet.

Formular problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Formular problem

    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

  • #2
    Bugeleisen
    That is due to a bug in the Formula Wizard in versions 7.8 and 7.9 which will be fixed in 7.9.1.
    In the Formula Wizard use the same commands that are listed under Alerts and Globals not those under Actions
    Alex

    Comment


    • #3
      How to change size of the arrows?

      They are a bit small.
      Thanks for your help.

      Comment


      • #4
        Bugeleisen
        The size of the arrows depends on the bar spacing and cannot be modified.
        Run a Search in this Bulletin Board using arrow* as the keyword and you can find examples of arrows drawn using drawTextRelative() and Wingdings font which you can implement also with the Formula Wizard
        Alex

        Comment

        Working...
        X