Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

high and low choice ?

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

    high and low choice ?

    hi guys how it is possible to determine the high and low like in picture
    thankz at all

    #2
    Hello faustf, thanks for your note.

    The Swing indicator does a similar calculation. You can look at the source code of Swing through the NinjaScript editor. There is also a MAX and MIN methods. This post has a lot of information on getting the highest high over a period of bars:


    The same concept can be applied for the lowest low.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      thankz i look if is good for me

      Comment


        #4
        Hi I am looking for the sound alert option for this Swing Indicator. I wonder how may i be able to request some one to enable the Swing High / Low alert? Very much appreciated.

        Comment


          #5
          Hi cyberjames2019, thanks for your note.

          The Swing indicator has methods that you can use to get either the bar number of the latest swing or the price of the latest swing. See all the helper methods on the documentation page here:
          Chris L.NinjaTrader Customer Service

          Comment


            #6
            Hello Chris,

            I am not sure how that is to be done to add the sound alert? It is something that I have to code it myself?

            Comment


              #7
              Hello cyberjames2019,

              Thanks for your reply and welcome to the NinjaTrader forums!

              If you wish to add a sound alert into the indicator itself, yes you would have to open the code and add the PlaySound() method. We do not provide coding services so if you would like that done for you we can provide a link to 3rd party programmers who can provide that service.

              An alternative you might want to test first would be to use "Chart Alerts" in NinjaTrader8 which allow you to configure alerts for the chart based on the applied price bars and indicators on the chart. In the case of the Swing Indicator, you could test to see if the current swing high value is not equal to the previous swing high value meaning the swing had changed which is what I suspect you are looking for. I'll post an example screenshot below of the alerts condition builder which is very similar to the strategy builder's nonprogramming interface.

              Here is the link to the Help guide for chart alerts: https://ninjatrader.com/support/helpGuides/nt8/?alerts.htm You'll want to review all of that section for help in understanding how to configure the alerts and the choices that you have.

              The example condition: Is the current bar of the SwingHigh not equal to the previous bar of the SwingHigh. The Swing low alert would be very similar except change the "indicator plot: to swing low.


              Click image for larger version

Name:	CJ-1.PNG
Views:	427
Size:	24.9 KB
ID:	1077369
              Paul H.NinjaTrader Customer Service

              Comment


                #8
                Thank you for your input. I am testing and exploring the chart alert.

                I came into a very strange situation that the alert will be disabled automatically? Each time I checked the enable box after awhile it will be disabled automatically. Could you please let me know why? and how to resolve it?

                Comment


                  #9
                  Hi cyberjames2019, thanks for your reply.

                  If your rearm type is set to Never then the alert will disable after it triggers. You can change it to OnBarClose, condition reversal, or a timer alternatively. This is covered in the Alert help guide section here:



                  Chris L.NinjaTrader Customer Service

                  Comment


                    #10
                    Thank you every one I am able to test out some alerts. However for the alert on the Swing Low and Swing High I think I am not getting the correct alert. Hence I think the best is to code the PlaySound() method. Is there any source code reference that i can refer to?

                    Comment


                      #11
                      Hello, thanks for your reply.

                      This code uses the swing indicator to find the swing high values:

                      Code:
                      namespace NinjaTrader.NinjaScript.Indicators
                      {
                          public class SwingAlert : Indicator
                          {
                      
                              Swing MySwing;
                              double prevSwingHigh = 0;
                      
                              protected override void OnStateChange()
                              {
                                  if (State == State.SetDefaults)
                                  {
                                      ... //setup code here
                                  }
                                  else if (State == State.DataLoaded)
                                  {
                                      MySwing = Swing(5);
                                  }
                              }
                      
                              protected override void OnBarUpdate()
                              {
                                  if(CurrentBar < 5)
                                      return;
                      
                                  if(MySwing.SwingHigh[0] != prevSwingHigh)
                                  {
                                      prevSwingHigh = MySwing.SwingHigh[0];
                                      Draw.Dot(this, CurrentBar + "NewSwing", false, 0, prevSwingHigh, Brushes.Purple);
                                      PlaySound(@"C:\mySound.wav");
                                  }
                              }
                          }
                      }
                      The documentation page on PlaySound has an example of how to use it in a script:



                      Chris L.NinjaTrader Customer Service

                      Comment


                        #12
                        Hi I would like to add the following into the attached CS file


                        PlaySound(@"\sounds\SwingHighEstablished.wav");

                        PlaySound(@"\sounds\SwingLowEstablished.wav");

                        May I know which lines are appropriate to add this code to alert the sound when a Swing High or Swing Low is drawn? I am not sure where exactly to insert. Thank you for your advice.
                        Attached Files

                        Comment


                          #13
                          Hi, thanks for your reply.

                          There's no need to modify the Swing source code for this. I attached a script that alerts on new swings. Place the script within Documents\NinjaTrader 8\bin\Custom\Indicators.
                          Attached Files
                          Chris L.NinjaTrader Customer Service

                          Comment


                            #14
                            Thank you so much! It works exactly what I am looking for.

                            Comment


                              #15
                              Hi fellas ,
                              How can i set up an chart alert for the Swing Indicator to get notified when the current swing High is higher than lets say 5 prior swing high´s after the current swing high indicator prints on my chart. Which is the correct set up? . Thank you in advance and my appreciation for any help.SEE Picture
                              Attached Files

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by DJ888, 04-16-2024, 06:09 PM
                              4 responses
                              12 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by terofs, Today, 04:18 PM
                              0 responses
                              11 views
                              0 likes
                              Last Post terofs
                              by terofs
                               
                              Started by nandhumca, Today, 03:41 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post nandhumca  
                              Started by The_Sec, Today, 03:37 PM
                              0 responses
                              3 views
                              0 likes
                              Last Post The_Sec
                              by The_Sec
                               
                              Started by GwFutures1988, Today, 02:48 PM
                              1 response
                              9 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Working...
                              X