Announcement

Collapse
No announcement yet.

tried adding alert but.....

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

  • tried adding alert but.....

    Hi-
    Totally new at efs. but I am trying to add an alert when the condition is met. Meaning when a DOT appears on my chart a "swoosh" sound will appear at the same time. I added the "swoosh wave" sound on lines 25 and 38 and it is working when a dot appears on my chart, however the sound keeps going off repeatedly as long as that particular price bar is current.
    I just want the sound to activate once.
    I attached an image so you can see where I put the wave sound line 25 and 38.
    I know i did something wrong here.
    Thanks for any help
    Attached Files

  • #2
    hi dido,

    This is occuring because the function main is cycling through every tick and the conditionals are true.

    Try adding something similar to this logic. that way, the alarm will go off only once per bar.

    PHP Code:
    var alarmBar null// create outside all functions making it a  global variable

    function main(){
     
     if (
    condition1 && condition2 && alarmBar != getCurrentBarCount()){
      
    alarmBar getCurrentBarCount();
      
    // ... your other actions here..
     
    }

    I hope this helps.

    Comment


    • #3
      steve

      Thanks for the quick response steve. I'm not sure where to place the info you gave me and if the orange type stays in the efs or do I replace it with the wav file. Sorry but I haven't a clue
      Thanks again

      Comment


      • #4
        dido,

        You are throwing your arms up in the air rather fast given that the conditional I provided was almost identical to your line 23. Sorry, I figured you were more advanced based on the code in-spite of your previous claim. The conditional was intended to use in the place of line 23 (and slightly modified by you for line 36). Everything else was in addition to what you already had.

        To save me re-typing your code from the image you posted previously, please re-post your code using the PHP tags available to you when you reply.

        Comment


        • #5
          sounds good

          Steve I think I got it. No errors have come up yet so thats a good sign. Just have to wait for a bar condition to be met. Thanks alot for your direction and help

          Comment


          • #6
            dido,

            You are most welcome, good to hear you are giving it a go. Hope it works out, but if not, let me know if you run into problems with this.

            Comment

            Working...
            X