Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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
    BertrandNinjaTrader Customer Service

    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.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Good to know. Thanks.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by algospoke, Yesterday, 06:40 PM
          2 responses
          19 views
          0 likes
          Last Post algospoke  
          Started by ghoul, Today, 06:02 PM
          3 responses
          14 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by jeronymite, 04-12-2024, 04:26 PM
          3 responses
          45 views
          0 likes
          Last Post jeronymite  
          Started by Barry Milan, Yesterday, 10:35 PM
          7 responses
          20 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by AttiM, 02-14-2024, 05:20 PM
          10 responses
          181 views
          0 likes
          Last Post jeronymite  
          Working...
          X