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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        579 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 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
        554 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