Announcement

Collapse
No announcement yet.

Alerts for indicators?

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

  • Alerts for indicators?

    I'm sure that this is a basic question that is easily answered, but I have not found a way to do this. I would like to have the built-in indicators in eSignal trigger an audible alert when certain conditions are met. For example, when MACD makes a crossover, is there a simple way to generate an audible alert for this condition?

    Thanks in advance,
    Jay Anderson

  • #2
    janderson,

    There are a few examples of these types of studies in the Alerts folder. Below is an example of the AlertMA.efs. This study generates two types of audible alerts when a certain condition is met. Hope this gets you started.

    PHP Code:
    /****************************************************************************************************
    Copyright © eSignal, a division of Interactive Data Corporation. 2002. All rights reserved. 
    This sample eSignal Formula Script (EFS) may be modified and saved under a new 
    filename; however, eSignal is no longer responsible for the functionality once modified.
    eSignal reserves the right to modify and overwrite this EFS file with each new release.
    *****************************************************************************************************/
    var study = new MAStudy(100"Close"MAStudy.SIMPLE);

    function 
    preMain() {
        
    setPriceStudy(true);
    }

    var 
    bIsLong false;
    var 
    bIsShort false;

    function 
    main() {
        var 
    study.getValue(MAStudy.MA);

        if(
    == null)
            return;


        if(
    close() >= v) {
            if(!
    bIsLong) {
                
    Alert.addToList(getSymbol(), "Price is >= 10 Bar MA"Color.blackColor.green);
                
    Alert.playSound("swoosh.wav");
                
    bIsLong true;
                
    bIsShort false;
            }
        } else {
            if(!
    bIsShort) {
                
    Alert.addToList(getSymbol(), "Price is < 10 Bar MA"Color.whiteColor.red);
                
    Alert.playSound("train.wav");
                
    bIsLong false;
                
    bIsShort true;
            }
        }

        return 
    v;

    Comment

    Working...
    X