Announcement

Collapse
No announcement yet.

Crossing a moving average alert!

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

  • Crossing a moving average alert!

    I'd like to modifiy the moving average library study. I'd like to have a sound alert when the price crosses the 200 ma. How do I go about it?

  • #2
    verna
    You would have a number of options available.
    Create the efs from scratch with the Formula Wizard or add the necessary code to the builtinMA.efs in the Builtin folder in Formulas.
    Both these options are very easy to implement but the drawback is that neither one allows you to modify the parameters of the MA from Edit Studies.
    The alternative is to download and modify the basicMA.efs study I posted in the ACM Test group at FileShare.
    All you would need to do then is add the following code

    if(close(-1)<vMA.getValue(MAStudy.MA,-1)&&close()>vMA.getValue(MAStudy.MA)){
    Alert.playSound("C:\\PROGRAM FILES\\ESIGNAL\\Sounds\\Ding.wav");
    }
    if(close(-1)>vMA.getValue(MAStudy.MA,-1)&&close()<vMA.getValue(MAStudy.MA)){
    Alert.playSound("C:\\PROGRAM FILES\\ESIGNAL\\Sounds\\Ding.wav");
    }

    where indicated by a comment in the formula itself.
    You could also modify the MA length default (again this is highlighted by comments in the efs)
    Alex

    Comment

    Working...
    X