Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how to add sound?

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

    how to add sound?

    Hello everybody.
    I want to add sound signal macd indicator.
    Now I use such code in my strategy which based on MACD
    if (CrossAbove( MACDB(10,2,12,26,9,1),0, 1))
    {
    PlaySound(@"C:\1.wav");
    }
    But how to include such code to indicator. And how to include list of sounds into options of indicator (because peopls like to choose different sounds)?

    #2
    Hello daglas,

    Thank you for your post.

    You can play sounds in an indicator in the same manner using the PlaySound() method.

    If you would like to allow the user to change the sound they can play, add a string variable in the indicator wizard and plug the variables name into PlaySound()

    Please let me know if I can assist you any further.
    DexterNinjaTrader Customer Service

    Comment


      #3
      I have two questions
      1) how to create (if it's possible) drop down list with predefined name of sound files in options of indicators.
      2) how I can include crossabove and cross bellow conditions into indicator MACD?
      Maybe such code:
      if ((fastEma[0] - slowEma[0])>(fastEma[1] - slowEma[1])
      {
      PlaySound(@"C:\1.wav");
      }
      if ((fastEma[0] - slowEma[0])<(fastEma[1] - slowEma[1])
      {
      PlaySound(@"C:\2.wav");
      }

      Comment


        #4
        Hello daglas,

        Thank you for your reply.

        You can create a drop-down list of items a user can select by using an enum variable. You can find an example of using enum variables here: http://www.ninjatrader.com/support/f...ead.php?t=3420

        You can also use CrossAbove() and CrossBelow() on your EMAs to check for cross above/belows. For an example of trading crossovers, please take a look at http://www.ninjatrader.com/support/f...ead.php?t=3224
        DexterNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        152 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        89 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        133 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        127 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        107 views
        0 likes
        Last Post CarlTrading  
        Working...
        X