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 highest/lowest close of a specific time range.

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

    How to get the highest/lowest close of a specific time range.

    The function HiLoOfTimeRange allows to get the high and low of the specified time range.
    I want to get the highest close of the specific time range. Is there a way to do it using this function?
    If not, what is the best way to do it.
    I think it would be good to incorporate this into this function.

    Also I want to be able to get the bar (its' time and volume) that had the highest close. How do I do this?
    I think it would be good to incorporate this into that function as well.

    Thanks.

    #2
    Open up the reference sample and use it to guide you how to do what you want. Off of memory, where you see something like MAX(High) use MAX(Close) etc...
    RayNinjaTrader Customer Service

    Comment


      #3
      Which reference sample.

      Which reference sample should I open up?

      Also coding MAX(Close, 20)[0]; will return the highest close of the last 20 bars. This is not what I need.
      Instead I need to get the highest close of the specified time range (as per my post).

      I have to somehow use HiLoOfTimeRange or variation thereof to get this.
      Unfortunately this function only has two paramenters: TheLow and TheHigh. What I need is TheClose.

      Comment


        #4
        TheHighestClose and TheLowestClose.

        In my last post I said TheClose, which would be to abstract. What I need is the HighestClose and/or the TheLowestClose.

        Does anyone know how to get this?

        Thanks

        Comment


          #5


          You will need to keep track of it manually throughout your specified time period. Also take a look at the time filter reference sample. It may provide additional information.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            Could HiLoOfTimeRange be changed to HiLoCloseOfTimeRange so that it would return the Close of a specified time range and make it return the Time that close occurred as well.

            And/Or can you create a function called CloseofTimeRange() which would return the highest/lowest close of a given time range and return the time that close occurred as well.

            Thanks

            Comment


              #7
              While we don't have a sample that does exactly this it could be done by modifying the existing code.

              You would would need to add a third plot and set this to the

              Close[endBarsAgo];



              Let me know if I can further assist.
              LanceNinjaTrader Customer Service

              Comment


                #8
                This would not work

                I don't think this would work as Close[endBarsAgo] implies you know how many bars back you are going and one would not know this info, hence the need to use something like I suggested previously.

                Would it be possible to add HiLowCloseOfTimeRange that would return the time as well and or CloseOfTimeRange() that would return the highest/lowest close, and the time the close was reached to the next NinjaTrader update?

                Thank you

                Comment


                  #9
                  To ensure we're talking about the same script, is this the script you're referring to? http://www.ninjatrader.com/support/f...ead.php?t=8600

                  In this script there was a variable created that defines the endBarsAgo of when the range ended, this is what I was referring to.

                  I will submit a feature request for the custom CloseOfTimeRange() method request. Currently you would need to create this method yourself to achieve this.

                  Let me know if I can further assist.
                  LanceNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by rjbtrade1, 11-30-2023, 04:38 PM
                  2 responses
                  77 views
                  0 likes
                  Last Post DavidHP
                  by DavidHP
                   
                  Started by cmtjoancolmenero, Yesterday, 03:58 PM
                  7 responses
                  30 views
                  0 likes
                  Last Post cmtjoancolmenero  
                  Started by Stanfillirenfro, Today, 07:23 AM
                  3 responses
                  13 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by FitSpressoHonest, Today, 09:14 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post FitSpressoHonest  
                  Started by Davide999, 05-18-2023, 03:55 AM
                  4 responses
                  557 views
                  1 like
                  Last Post kcwasher  
                  Working...
                  X