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

How to get the second highest high/lowest low

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

    How to get the second highest high/lowest low

    Is there a way to get the second Highest High or the Second Lowest Low for X bars back?

    This is to get other relevant bars not necessarily the highest or lowest ones.

    Thanks,

    taddypole...

    #2
    Hello Taddypole,

    Thank you for your post.

    There is no supported method in NinjaScript to pull this information.
    However, you can custom program an array of the bars that you wish to run this check on and sort them by descending and grab index number 1 (which would be the second highest value) and then sort by ascending and grab index 1 again for second lowest value. This of course would need to be done manually through hard coding.

    Please let me know if I may be of further assistance.

    Comment


      #3
      Thanks PatrickH...

      I had these tools in TradeStation and was hoping they were available in Ninja Trader as part of the tool box.
      Never having programmed software as a profession, i guess I'll have to study this to see if i can come up with a solution.

      regards,


      taddypole...

      Comment


        #4
        Originally posted by NinjaTrader_PatrickH View Post
        Hello Taddypole,

        Thank you for your post.

        There is no supported method in NinjaScript to pull this information.
        However, you can custom program an array of the bars that you wish to run this check on and sort them by descending and grab index number 1 (which would be the second highest value) and then sort by ascending and grab index 1 again for second lowest value. This of course would need to be done manually through hard coding.

        Please let me know if I may be of further assistance.
        Hi Patrick H,

        I'm thinking of doing something very similar.

        I'd like to find the third prior lower low of the current bar (assuming a certain lookback period).

        Are you referring to Low[int barsAgo] and Lows[int barSeriesIndex][int barsAgo]?
        The examples in the help guide do not provide sufficient information for me to code what was suggested in your answer. Can you expand on the examples provided in the help guide to elaborate your answer?

        Thanks,

        Richard
        Last edited by Richard168; 02-28-2013, 11:39 PM.

        Comment


          #5
          Originally posted by Richard168 View Post
          Hi Patrick H,

          The examples in the help guide do not provide sufficient information for me to code what was suggested in your answer. Can you expand on the examples provided in the help guide to elaborate your answer?
          I second that...I'm looking for something similar (tracking the most recent 2 swing highs)
          but haven't haven't been able to find any useful examples. If you could provide any help or guidance it would be appreciated, thanks.

          Comment


            #6
            mk:@MSITStore:C:\PROGRA~2\NINJAT~1\doc\NINJAT~1.CH M::/swing.htm

            Comment


              #7
              Sorry. Now its right

              Comment


                #8
                Originally posted by Baruch View Post
                Hi Baruch,

                In my original note, I was looking for ways to find the previous lower lows. I have a very cumbersome approach in mind which is to compare Low[i]'s over a certain lookback period.

                Do you have any suggestions?

                Thanks,

                Richard

                Comment


                  #9
                  Patrick's suggestion is a good one.

                  Comment


                    #10
                    Hello Richard168,

                    I have created a sample of calculating the three highest highs for a period.

                    This indicator is called ThreeHighest.

                    Follow these steps to import an indicator:
                    • Download the indicator to your desktop, keep them in the compressed .zip file.
                    • From the Control Center window select the menu File > Utilities > Import NinjaScript
                    • Select the downloaded .zip file
                    • NinjaTrader will then confirm if the import has been successful.

                    Note that on any files that say "File already exists on your PC" that start with an "@" symbol are the ones that came preloaded inside of NinjaTrader so you would say "No" so that you do not override those files.

                    Let me know if you have any questions.
                    Attached Files
                    Chelsea B.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by junkone, Today, 11:37 AM
                    0 responses
                    1 view
                    0 likes
                    Last Post junkone
                    by junkone
                     
                    Started by quantismo, 04-17-2024, 05:13 PM
                    5 responses
                    34 views
                    0 likes
                    Last Post NinjaTrader_Gaby  
                    Started by proptrade13, Today, 11:06 AM
                    1 response
                    5 views
                    0 likes
                    Last Post NinjaTrader_Clayton  
                    Started by love2code2trade, 04-17-2024, 01:45 PM
                    4 responses
                    34 views
                    0 likes
                    Last Post love2code2trade  
                    Started by cls71, Today, 04:45 AM
                    2 responses
                    10 views
                    0 likes
                    Last Post eDanny
                    by eDanny
                     
                    Working...
                    X