Announcement

Collapse
No announcement yet.

A simple price level alert

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

  • A simple price level alert

    This basic alert differs from built in alerts by being set within a chart; it draws a line at the alert level. You can also pause the
    klaxon so it doesn't yell constantly.
    PHP Code:
    /* PriceAlert.efs  -- sound when a price is touched.
        Use Edit Studies to set price.
        Set Pause to numSeconds to wait between sounds.
        Don't setComputeOnClose--it may skip your price.
    */
    function preMain() {
        
    setPriceStudy(true);
        
    setStudyTitle("PrAlert");
        
    setCursorLabelName("PrAl"0);
    }
    var 
    lastAlertTime null;
    function 
    main(numPricenumPause) {
        if (
    numPrice == nullnumPrice 0;
        if (
    numPause == nullnumPause 0;
        var 
    null;

        if (
    close() == numPrice
            
    getValue("rawtime");
            if (
    lastAlertTime 60) {
                
    Alert.playSound("train.wav");
                
    lastAlertTime t;
            }
        return 
    numPrice;    

Working...
X