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

Code a sound

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

    Code a sound

    Can someone please help to add a sound alert to this indicator, would very much be appreciated.
    Attached Files

    #2
    Hello,

    Thank you for the question.

    If you are able to edit the source code for the indicator you are looking at I could tell you what methods you would need to use in order to play a sound.

    I am not able to directly edit third party items though so if this is something you did not directly create I would be unable to modify its code. I can instruct you on what is needed to do this though.

    The first step would be to see if you can edit the code, please go to Tools -> Edit NinjaScript -> Indicator and look for the indicator in question.

    if you can open the indicator to where you can see the code you would need to look for the lines where the arrows are being drawn.

    Before I get too ahead of myself I will let you see if you can edit this item, please let me know if you can and I will provide the steps you need.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Yes I can edit the code. In pdf a copy of the code
      Sorry but my english is terrible
      Cordially
      Attached Files

      Comment


        #4
        Hello,

        Thank you for the reply.

        In this case because you can edit the code and the logic is already there, you would just need to add a few lines in.

        You will be looking in the code for the following two lines, directly after these lines on a new line you would need to add in the PlaySound or Alert method.

        First look for the line DrawArrowUp(
        Below this line you would need to add the first alert in, or

        PlaySound("Alert1.wav");

        If you only want to play a sound, you can use PlaySound method. Here is the help guide reference; http://www.ninjatrader.com/support/h...tsub=PlaySound

        Otherwise if you would also like an alert that you hear and see in the File -> New -> Alerts panel, you would need to use the Alert() method. http://www.ninjatrader.com/support/h...lightsub=alert

        Next you would repeat this step for the Down arrow, so look for the DrawArrowDown( and add the next alert below this statement.

        Here is an example of one that I located in the code provided.

        The existing code:
        Code:
        if(currentUpTrend && !priorUpTrend)
         DrawArrowUp("arrow" + CurrentBar, true, 0, newStop -
        0.5*offset, upColor);
        What you would add:

        Code:
        if(currentUpTrend && !priorUpTrend)
        [B]{[/B]
         DrawArrowUp("arrow" + CurrentBar, true, 0, newStop -
        0.5*offset, upColor); 
        [B]PlaySound("Alert1.wav");[/B]
        [B]}[/B]
        Please let me know if I may be of additional assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Originally posted by Ferracano View Post
          Can someone please help to add a sound alert to this indicator, would very much be appreciated.
          I have coded that indicator. It already comes with sound alerts. Maybe you have an outdated version which you have picked up somewhere.

          The up-to-date versions of the SuperTrend indicators are the SuperTrendM11 and the SuperTrendU11, which can be found here:

          The best futures trading community on the planet: futures trading, market news, trading charts, trading platforms, trading strategies

          The best futures trading community on the planet: futures trading, market news, trading charts, trading platforms, trading strategies


          If you are not an elite member of Big Mike's send me a private message with your e-mail, and I will send you the indicators.

          Comparison between SuperTrend M1 and SuperTrend M11:

          The SuperTrend M11 calculates both the average true range and the median 1 bar ago. This results in a considerable saving in CPU load, if you use the indicators in CalculateOnBarClose = false mode. The SuperTrend M11 does the median calculation only once per bar, while the SuperTrend M1 recalculates it with every incoming tick. If you use the indicator with CalculateOnBarClose = true setting, you can also continue to use the SuperTrend M1. There will be no significant difference in performance.

          Changed formula: The Supertrend M11 will give slightly different results, when compared with the Supertrend M1. If you want to reproduce the settings of your Supertrend M1, you should use the same value for the ATR period and the ATR multiplier, but reduce the value for the median period by 1. The result will still not be identical. Also for both indicators a minimum size for the ATR values has been imposed, the ATR may not be smaller than the ticksize. This is only important for lower timeframes during low volatility and prevents the SuperTrend from changing the trend too often.


          All indicators, SuperTrendM1, SuperTrendM11 and SuperTrendU11 come with sound alerts. The only thing you need to do is to create your own sound files and copy them to the NinjaTrader sounds folder. Then select the sound files via indicator dialogue box.
          Last edited by Harry; 01-26-2015, 12:41 PM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by elirion, Today, 01:36 AM
          0 responses
          3 views
          0 likes
          Last Post elirion
          by elirion
           
          Started by gentlebenthebear, Today, 01:30 AM
          0 responses
          3 views
          0 likes
          Last Post gentlebenthebear  
          Started by samish18, Yesterday, 08:31 AM
          2 responses
          9 views
          0 likes
          Last Post elirion
          by elirion
           
          Started by Mestor, 03-10-2023, 01:50 AM
          16 responses
          389 views
          0 likes
          Last Post z.franck  
          Started by rtwave, 04-12-2024, 09:30 AM
          4 responses
          34 views
          0 likes
          Last Post rtwave
          by rtwave
           
          Working...
          X