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

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.

    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?

        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

            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?

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Rapine Heihei, Today, 08:19 PM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by Rapine Heihei, Today, 08:25 PM
                0 responses
                5 views
                0 likes
                Last Post Rapine Heihei  
                Started by f.saeidi, Today, 08:01 PM
                1 response
                4 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by Rapine Heihei, Today, 07:51 PM
                0 responses
                6 views
                0 likes
                Last Post Rapine Heihei  
                Started by frslvr, 04-11-2024, 07:26 AM
                5 responses
                98 views
                1 like
                Last Post caryc123  
                Working...
                X