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 for new bar

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

    Alert for new bar

    Hi everyone

    I'd like to have an indicator which gives me a sound alert 2 minutes, say, before the close of each time-based bar.

    I've found that the time methods in NT are usually more tricky than usual to code up.

    I know how to handle the alert aspect, but I'd appreciate some help as to how to code up the line with the time condition. (I'll have the following variable: int AlertTime = 2)

    If such an indicator already exists somewhere, thanks for pointing me to it.

    Thanks in advance.

    #2
    Hello,

    Thank you for the question.

    If you are on a Time based chart this would be easy to do by modifying the existing bar timer indicator.

    If you open the BarTimer indicator and then right click and save as to generate a duplicate, you could add the following to create a timed alert.

    Look in the script for the following line:

    Code:
    TimeSpan	barTimeLeft = Bars.GetTime(Bars.Count - 1).Subtract(Now);
    Below this line add the following:

    Code:
    if(barTimeLeft == new TimeSpan(0,2,0))
    {
    	//do your alert here, this will trigger once when the time is met. 
    }
    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks very much, Jesse.

      You've not only told me how to achieve this but I've also found out about BarTimer, which itself is very helpful.

      Much obliged.

      Comment


        #4
        I had added an audio alert to the bar timer back in 2012. You can download the indicator here:

        The best futures trading community on the planet: futures trading, market news, trading charts, trading platforms, trading strategies


        If you are not a member of the forum, please send me a private message.

        Comment


          #5
          Originally posted by Harry View Post
          I had added an audio alert to the bar timer back in 2012. You can download the indicator here:

          The best futures trading community on the planet: futures trading, market news, trading charts, trading platforms, trading strategies


          If you are not a member of the forum, please send me a private message.
          Thanks very much, Harry. I'm a BMT member, so there was no problem.

          If it works as well as the other terrific indicators you've so kindly shared with the trading community, I'm sure it will be extremely helpful.

          Cheers.

          Comment


            #6
            Hi Ninja Trader Jessie, i notice this thread is old, and I'm on Ninja Trader 8. I like to know if there is a Ninja Trader 8 bar timer alert indicator available for download? one that will make a beep or sound when the bar finishes or starts.
            Thanks, Kriptikon

            Comment


              #7
              Hello kriptikon,

              There is a bar timer which comes with the platform however I am not aware of one that makes any alerts. You could take a look on the user app share or also create one based on the existing timer.


              The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

              Please let me know if I may be of additional assistance.
              JesseNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by sidlercom80, 10-28-2023, 08:49 AM
              166 responses
              2,233 views
              0 likes
              Last Post sidlercom80  
              Started by thread, Yesterday, 11:58 PM
              0 responses
              1 view
              0 likes
              Last Post thread
              by thread
               
              Started by jclose, Yesterday, 09:37 PM
              0 responses
              6 views
              0 likes
              Last Post jclose
              by jclose
               
              Started by WeyldFalcon, 08-07-2020, 06:13 AM
              10 responses
              1,414 views
              0 likes
              Last Post Traderontheroad  
              Started by firefoxforum12, Yesterday, 08:53 PM
              0 responses
              11 views
              0 likes
              Last Post firefoxforum12  
              Working...
              X