Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Alert once per bar

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

    Alert once per bar

    Hi,

    I have an alert which is working fine, I have set the rearm to 30seconds but it is still too often. Can I do something to make it alert only once per bar?

    Code:
    Alert("dvalertbonds", Priority.High, "BONDS" + "  " + Close [0], @"C:\Program Files\NinjaTrader 7\sounds\bonds.wav", 30, Color.Red, Color.White);

    #2
    Hi ScottieDog, yes you can for example look into working via bool flags to trigger the alert / sound call only once per bar - an example to get started was shared here on the forums a while back - http://www.ninjatrader.com/support/f...50&postcount=8

    Comment


      #3
      If I set it to 59 seconds.... and a new bar forms before the 59 seconds is complete, will it alert on the new bar open, or only when 59 seconds has elapsed from the last alert?

      Can more than 59 seconds be defined? Is there a maximum?

      Thanks for the info on the bool, i´ll look more at that, I did know about that option. It´s a little bit over my head at the moment so I really wanted a simpler solution to immediately put inline with the code... I need to advance though, so will be reading about the bool etc, which I already have a tiny bit of knowledge on.

      Comment


        #4
        There's no real maximum and you could go higher than 60 secs, however the last alert time counts to decide if to retrigger it or not, so would not have to do with getting a new bar as in your example.

        Comment


          #5
          Good to know. Thanks.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          558 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          324 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          545 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          547 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X