Announcement

Collapse
No announcement yet.

reset alert automatically

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

  • reset alert automatically

    I'm trying to set an audible alert for some statistics that oscillate like $add, $ticki, etc. I'd like to get an alert every time it goes through a certain level without having to reset it. I only see how to re-arm it if it increases incrementally from the original alert value. Is there a way to get an alert every time $ticki goes above 20?

    Thanks.

  • #2
    efremiv
    You could do it with an efs. Actually the same efs could cover up to 5 symbols and provide alerts on each.
    Alex

    Comment


    • #3
      You can accomplish this with...

      Alert Flags....

      What I mean is by setting an ON/OFF switch for each alert within your code.. This would allow for an automated "reset" of the alerts..

      For example....

      PHP Code:
      var Alert1Flag false;
      var 
      Alert2Flag false;


      function 
      main() {

        if ((
      getValue("$ticki") <  20) && (!Alert1Flag)) {
         
      //  reset the alert flag for this condition
          
      Alert1Flag true;
        }
        if ((
      getValue("$add") <  50) && (!Alert2Flag)) {
         
      //  reset the alert flag for this condition
          
      Alert2Flag true;
        }


      //  Test for alert conditions.
        
      if ((getValue("$ticki") >  20) && (Alert1Flag)) {
          
      Alert.addToListgetSymbol(), "$Ticki Alert"Color.blackColor.green );
          
      Alert1Flag false;
        }

        if ((
      getValue("$add") >  50) && (Alert2Flag)) {
          
      Alert.addToListgetSymbol(), "$Add Alert"Color.blackColor.green );
          
      Alert2Flag false;
        }

      This may not be exacly what you mean, but I think it addresses the issue of "resetting the alerts".

      Hope this helps..

      B
      Brad Matheny
      eSignal Solution Provider since 2000

      Comment

      Working...
      X