Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Higher/lower highs/lows calc...

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

    Higher/lower highs/lows calc...

    Hi,
    Could not find anything on this topic. How to add Lower high/Higher low calculations to my custom indicator please? is there method/formula or such? Looking for easy way...
    Thank you very much.
    Regards, Art.

    #2
    Hello,

    Thanks for your forum post.

    Best way would be to use Swing() that is a native NinjaTrader method.




    Let me know if I can be of further assistance.
    BrettNinjaTrader Product Management

    Comment


      #3
      Thank you very much. I reviewed the Swing() but a bit confused... Do I need to specify bars ago parameter? What if I do not know haw many bars ago my swing high/low was. Do I need to check all bars between swings? The very next bar could be higher then previous one... Did I misunderstand this method?
      Thank you.
      Regards, Art

      Comment


        #4
        Hello,

        Yes you would need a look back period, If you want to check the entire chart you would need to set this to CurrentBar.


        It isnt as cut and dry as just using the Swing() indicator. As this only identified Swing Hi's and Low's


        You will need to track these values that are identified and then trace the Swing Hi and Swing low prices to termain if the price is a higher high or a lower high. You can do this all with the Swing() indicator finding the lower swing and higher swing prices with your defined strength settings.

        Suggest adding the Swing() indicator to a chart to get an idea for the value's it outputs and how you would use that to decide if its a HH.LH.LL. or LH.


        Let me know if I can be of further assistance.
        BrettNinjaTrader Product Management

        Comment


          #5
          Thank you.
          Is there a way/method to get swings high/low on the indicators such as MACD and/or Stoch. please?
          Thank you very much.

          Comment


            #6
            Hello,

            Yes you can use that same Swing Indicator.

            However overload the input series to be the indicator instead of the price action.

            Swing(IDataSeries input, int strength).SwingLow[int barsAgo]

            IDataSeries Input instead of this being Close[0]. Put in Macd, MACD(12, 26, 9)[0]


            Let me know if I can be of further assistance.
            BrettNinjaTrader Product Management

            Comment


              #7
              Hi Brett,
              Can you give some example please. I'm trying the following and get errors...

              double prevMacdHigh = Swing(5).SwingHigh(MACD(5,20,30))[0];
              or
              double prevMacdHigh = Swing(5).SwingHighBar(MACD(5,20,30)[0], 1, 10);

              Thank you very much.

              Comment


                #8
                Hello,

                Your formatting is way off:

                Swing(IDataSeries input, int strength).SwingLow[int barsAgo]


                There are only () afer swing. You have them on Swing() and also the .SwingLow.

                The SwingLow is only [0]

                For example the correct syntax would be as follows:

                double prevMacdHigh = Swing(MACD(12, 26, 9), 5).SwingHigh[0];

                Let me know if I can be of further assistance.

                BrettNinjaTrader Product Management

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                574 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                332 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                101 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                553 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                551 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X