Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

sounds added dont work

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

    sounds added dont work

    How do make the sound alert for this? i copied part of it below:
    i tried it with Alert() which I //'d out below and with PlaySound() which was my latest try. The re-coloring works fine.

    // Condition set 2
    if (High[0]-Low[0] >= (TickSize*dist) //0.1
    && Close[0] < Open[0])//&&Open[0]-Close[0]>=0.1)
    {
    BarColor = Color.DeepPink;
    }
    if (AlertBool == true)
    // Alert("size",NinjaTrader.Cbi.Priority.Medium, " dn barsize","Alert2.wav",0,BarColor,Color.DeepPink);
    PlaySound(@"C:\Program Files\NinjaTrader 7\sounds\Alert1.wav");

    In the Properties section I have this:

    [Description("Sound and display an alert with Alerts window open ")]
    [Category(
    "Parameters")]
    [Gui.Design.DisplayNameAttribute(
    "Alert on Begin/End?")]
    publicbool AlertBool
    {
    get { return alertBool; }
    set { alertBool = value; }
    }

    #2
    Hello,

    Can you please add a print to line where the Sounds should make noise. As I would expect it to do so. Also please make sure the file path is good and the file is there and plays.

    I look forward to assisting you further.
    BrettNinjaTrader Product Management

    Comment


      #3
      what does that mean in english?

      Comment


        #4
        Add the following.

        if (AlertBool == true && !Historical)
        {
        // Alert("size",NinjaTrader.Cbi.Priority.Medium, " dn barsize","Alert2.wav",0,BarColor,Color.DeepPink);
        PlaySound(@"C:\Program Files\NinjaTrader 7\sounds\Alert1.wav");

        Print(Time[0] + " : MY SOUNDS SHOULD HAVE WORKED");
        }


        Then check in the output window->Control Center->Tools->Output window.

        Do you see my sounds should have worked there?
        BrettNinjaTrader Product Management

        Comment


          #5
          i'll try that.
          i know the sound plays because if i only have
          if (AlertBool == true)
          PlaySound(Alert1.wav");


          it alerts every tick.



          Comment


            #6
            Hello,

            Also, can you please go manually to this folder location and try to play the file with a media player such as windows media player does it play and you can hear the sound?

            C:\Program Files\NinjaTrader 7\sounds\Alert1.wav
            BrettNinjaTrader Product Management

            Comment


              #7
              i tried that when i first wrote the line because i copied it from a 6.5 script and didnt know if Alert1 was in the 7 sounds folder or if i needed to call it 7 or 7.0
              it did work.

              Comment


                #8
                ok and the results of our test with the print line? You got the print but did not get sound correct?
                BrettNinjaTrader Product Management

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                574 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                333 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
                553 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                551 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X