Announcement

Collapse
No announcement yet.

how do you cancel alerts for day

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

  • how do you cancel alerts for day

    My code will not let a alert trigger come in when the high is 50 cents or 3%above the 9:30 opening bar high. I went it to cancel the alerts for the day when this situation happens. So if a stock goes up 80 cents and come back down 80 cents right now it will trigger an alert since it is below the 50 cents. I went it to cancel for the rest of the day since it broke the 50 cents.

    Here is how i have it in my code
    ((high-1) <(FirstHigh) +.50)) &&

    Thanks

  • #2
    Re: how do you cancel alerts for day

    sjsr
    Use the logic provided in the AlertOncePerBar.efs sample script which is posted here and in addition to checking for BARSTATE_NEWBAR which resets the vFlag variable to false at every first tick of a new bar you also check for a change of date ie
    if(getBarState()==BARSTATE_NEWBAR && day(0)!=day(-1))
    which will reset the variable on the first tick of each day
    Alex


    Originally posted by sjsr
    My code will not let a alert trigger come in when the high is 50 cents or 3%above the 9:30 opening bar high. I went it to cancel the alerts for the day when this situation happens. So if a stock goes up 80 cents and come back down 80 cents right now it will trigger an alert since it is below the 50 cents. I went it to cancel for the rest of the day since it broke the 50 cents.

    Here is how i have it in my code
    ((high-1) <(FirstHigh) +.50)) &&

    Thanks

    Comment

    Working...
    X