Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sound alert on new arrow

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

    Sound alert on new arrow

    Dear community,

    I have an indicator which produces arrows by some conditions. Now I want to have a sound alert on every arrow. I'm not allowed to edit this indicator so I have to write an indicator for sound messages on every new up/down arrow.

    Can someone guide me with the coding?

    Thanks in advance
    Max

    #2
    Hello,

    Thank you for the question.

    There are a couple of ways to do this and will depend on what you have access to in the indicator that plots the arrows.

    The easy way to accomplish this would be to use the same equation that is used in the indicator that draws the arrows. You could create a separate indicator that uses this logic to create sound instead of arrows.

    Being that the indicator is not editable this would probably not be an option.

    The second option would be to use the indicator that is not editable as a trigger.

    You can do this although it would require that the indicator that can not be edited exposes either a plot that is used in creating the arrows or some other value that indicates that there was a arrow created.

    One way to check this would be to do the following in an indicator.

    Type the name of the indicator that can not be edited followed by ( ) with any overloads that are needed and then a period. This will expand the intellisense and you can look through the list to see if there are any plots listed that are also listed in the indicators properties on the chart.

    This is a example of the above in code using the Stochastics indicator
    Code:
    Stochastics(Close, 10, 14, 2).K
    Notice after the parenthesis I have added the .K to access the K dataSeries of the Stochastics indicator, you can try something similar to see if there are any exposed variables or data series.

    If there is no exposed value for you to see in your second indicator there would be no signals to determine when an arrow is made.

    Please let me know if I may be of additional assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello,

      Thank you for the question.

      There are a couple of ways to do this and will depend on what you have access to in the indicator that plots the arrows.

      The easy way to accomplish this would be to use the same equation that is used in the indicator that draws the arrows. You could create a separate indicator that uses this logic to create sound instead of arrows.

      Being that the indicator is not editable this would probably not be an option.

      The second option would be to use the indicator that is not editable as a trigger.

      You can do this although it would require that the indicator that can not be edited exposes either a plot that is used in creating the arrows or some other value that indicates that there was a arrow created.

      One way to check this would be to do the following in an indicator.

      Type the name of the indicator that can not be edited followed by ( ) with any overloads that are needed and then a period. This will expand the intellisense and you can look through the list to see if there are any plots listed that are also listed in the indicators properties on the chart.

      This is a example of the above in code using the Stochastics indicator
      Code:
      Stochastics(Close, 10, 14, 2).K
      Notice after the parenthesis I have added the .K to access the K dataSeries of the Stochastics indicator, you can try something similar to see if there are any exposed variables or data series.

      If there is no exposed value for you to see in your second indicator there would be no signals to determine when an arrow is made.

      Please let me know if I may be of additional assistance.
      At first, thank you for your post.

      I tried to reach my indicator with

      Code:
      myIndicatorName(Parameters).K
      but that doesn't work. Isn't it possible to get all objects from the current candle and if it's an arrow, there has to be an alert?

      Comment


        #4
        Hello,

        Thank you for the reply.

        That would not work as I assume there is no "K" value in the indicator you are trying to access.

        The "K" is the plot name in the Stochastics indicator, if you were to load the Stochastics indicator on a chart and look in the properties in the plots section, you will find the K plot.

        Please try this to help narrow down what plots are available in the indicator you are working with.

        On a chart, load the indicator you are trying to access.
        In the indicators properties, look at the names of the plots that are available, also take note if the plots may have anything to do with when the arrows are generated.

        Now back in the indicator, replace the "K" with one of these plot names.

        If you are successful you can access the values of that plot and create logic based on that.

        It is unlikely that they have created the indicator to use a plot only for arrow locations but rather they are placing the arrows based on a calculation that is done using one of the plots in the indicator.

        More thank likely even if you are able to access the plots they use you will need to come up with some sort of equation to determine where to place the arrows or in your case where to fire off the sound alert.

        Please let me know if I may be of additional assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Yes, that's the problem. I don't trigger the .K value of my indicator. I just place the '.', but there is nothing I can choose to trigger. It seems that I can't trigger my indicator. It's also not listed withing the Edit Indicators list.

          So my question would be. Can I make an indicator which shows at the current candle and if there appears an arrow it will print an alert?

          Comment


            #6
            Hello,

            The "K" value was just meant to be an example in this case.

            As for your question : Can I make an indicator which shows at the current candle and if there appears an arrow it will print an alert?

            Can you elaborate more on this I am not sure I understand what you are trying to do.
            I understand that you want this to be on the current bar but what causes the arrow to draw and alert?

            You can certainly create a indicator that alerts you based on conditions based on the data on the chart.

            If you would like to email me at platformsupport @ ninjatrader.com and refernce the address to this page in the body, we can set up a remote asssitance call so that I can better see what you are trying to do and help explain the editor a little better.


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

            Comment


              #7
              Originally posted by arroganzmaschine View Post
              At first, thank you for your post.

              I tried to reach my indicator with

              Code:
              myIndicatorName(Parameters).K
              but that doesn't work. Isn't it possible to get all objects from the current candle and if it's an arrow, there has to be an alert?
              Once a DrawObject appears on a chart, that object is one of the DrawObjects collection, so you can query that collection and take any action that you want based on the addition of that new DrawObject. There is more than one way to query if a new object has appeared, so that you can start processing said new object. The quickest that comes to mind are to see if the DrawObjects.Count has increased on that bar. That means that you have to keep a record of the current count, to be compared to the count on the new bar.

              There are some very focused examples in the literature. Study them for ideas.

              ref: http://www.ninjatrader.com/support/h...rawobjects.htm

              Comment


                #8
                Originally posted by koganam View Post
                Once a DrawObject appears on a chart, that object is one of the DrawObjects collection, so you can query that collection and take any action that you want based on the addition of that new DrawObject. There is more than one way to query if a new object has appeared, so that you can start processing said new object. The quickest that comes to mind are to see if the DrawObjects.Count has increased on that bar. That means that you have to keep a record of the current count, to be compared to the count on the new bar.

                There are some very focused examples in the literature. Study them for ideas.

                ref: http://www.ninjatrader.com/support/h...rawobjects.htm
                That seems to be a good idea. I will try this one out. So I have a temp variable which contains the current DrawObjects.Count. At OnBarUpdate I have to check if it increased and then play an alert. How can I play an alert?

                Comment


                  #9
                  Originally posted by arroganzmaschine View Post
                  That seems to be a good idea. I will try this one out. So I have a temp variable which contains the current DrawObjects.Count. At OnBarUpdate I have to check if it increased and then play an alert. How can I play an alert?
                  Not quite so simple. You will have to check that the newly added DrawObject is the type that you are querying, then act on that.

                  You use the Alert() method to raise an alert. You can also use PlaySound(), or indeed any C# method that you may choose.

                  ref: http://www.ninjatrader.com/support/h.../nt7/alert.htm
                  http://www.ninjatrader.com/support/h.../playsound.htm
                  Last edited by koganam; 09-04-2014, 09:20 AM.

                  Comment


                    #10
                    That's weird. I want to detect every new drawing on the chart. When I draw them on my own, I get an alert. If the indicator draws them, nothing happens.

                    Any suggestions?

                    Comment


                      #11
                      Originally posted by arroganzmaschine View Post
                      That's weird. I want to detect every new drawing on the chart. When I draw them on my own, I get an alert. If the indicator draws them, nothing happens.

                      Any suggestions?
                      You will have to examine the way that you are processing the object counts. It seems that your code may be processing the count in a manner where it sees the indicator's updated count too early.
                      Last edited by koganam; 09-06-2014, 10:45 AM.

                      Comment


                        #12
                        Originally posted by koganam View Post
                        You will have to examine the way that you are processing the object counts. It seems that your code may be updating the processing the count in a manner where it sees the indicators updated count too early.
                        I just count every object on the chart with
                        Code:
                        DrawObjects.Count
                        So I thought it will also count the objects from the indicator and not just my own drawings.

                        Comment


                          #13
                          Originally posted by arroganzmaschine View Post
                          I just count every object on the chart with
                          Code:
                          DrawObjects.Count
                          So I thought it will also count the objects from the indicator and not just my own drawings.
                          That is a single expression that gets the count of the objects. It does not say anything about how you are processing the change in count, or whatever else you are doing. That expression will return the count all the draw objects, period, no matter how they are drawn.

                          Use a Print() statement after you call the count, and you can see it increase every time a new draw object appears.

                          If you are not getting a response from the appearance of a new draw object, it is because your code is not processing the way that you want it do: it most assuredly is processing they way that you have instructed it to do. Bring your code into alignment with your intent.
                          Last edited by koganam; 09-06-2014, 10:49 AM. Reason: Corrected programming syntax.

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by smk200, Today, 10:29 AM
                          0 responses
                          2 views
                          0 likes
                          Last Post smk200
                          by smk200
                           
                          Started by Austiner87, Today, 09:44 AM
                          2 responses
                          16 views
                          0 likes
                          Last Post Austiner87  
                          Started by TriGuy818, Today, 09:19 AM
                          2 responses
                          14 views
                          0 likes
                          Last Post TriGuy818  
                          Started by 7robert, Today, 09:12 AM
                          1 response
                          11 views
                          0 likes
                          Last Post NinjaTrader_Kate  
                          Started by space_trader, Today, 09:11 AM
                          2 responses
                          25 views
                          0 likes
                          Last Post space_trader  
                          Working...
                          X