• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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)
        {
         DrawArrowUp("arrow" + CurrentBar, true, 0, newStop -
        0.5*offset, upColor); 
        PlaySound("Alert1.wav");
        }
        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:

          https://www.bigmiketrading.com/downl...-download.html
          https://www.bigmiketrading.com/downl...load.html?view

          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 chartish, Today, 04:43 PM
          0 responses
          2 views
          0 likes
          Last Post chartish  
          Started by Trader17, Today, 04:07 PM
          0 responses
          1 view
          0 likes
          Last Post Trader17  
          Started by GussJ, Today, 01:30 PM
          2 responses
          17 views
          0 likes
          Last Post GussJ
          by GussJ
           
          Started by GARZONJ, Today, 12:25 PM
          3 responses
          15 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Started by RandanAL, Today, 11:53 AM
          1 response
          13 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X