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

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 ender_wiggum, Today, 09:50 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by rajendrasubedi2023, Today, 09:50 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by geotrades1, Today, 10:02 AM
        0 responses
        4 views
        0 likes
        Last Post geotrades1  
        Started by bmartz, Today, 09:30 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by geddyisodin, Today, 05:20 AM
        3 responses
        24 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X