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

Lowest(Low,5) 1 bar back ?

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

    Lowest(Low,5) 1 bar back ?

    Hi all

    I know the function LowestBar(DataSeries,barsago) and it's a great function but my problem is that I would like to find the lowest low bar for the past 20 bars BUT 1 BAR AGO. Is there an elegant way to find that ?


    Many thanks

    Bernard

    #2
    Unfortunately I am not following you. What do you mean by "past 20 bars but 1 bar ago"? If you mean the value of the function on the previous bar, to get that you would have had to just run that calculation on the previous bar and saved its value for access on the current bar.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Josh

      I could do that but unfortunately the number of bars back is known only on the current bar

      Bernard

      Comment


        #4
        Create an IntSeries and store it for every bar?
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Try This:

          double value = Min(Low, 20)[1];
          RJay
          NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

          Comment


            #6
            Note: Min's give the actual values and not the bar numbers.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Josh

              Thank you.
              I had to create my own for loop to get the data I need

              Thaks

              Bernard

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by PhillT, 04-19-2024, 02:16 PM
              3 responses
              14 views
              0 likes
              Last Post mangel2000  
              Started by TraderBCL, Today, 02:37 AM
              0 responses
              1 view
              0 likes
              Last Post TraderBCL  
              Started by mangel2000, Today, 02:23 AM
              0 responses
              5 views
              0 likes
              Last Post mangel2000  
              Started by mangel2000, Today, 01:30 AM
              0 responses
              13 views
              0 likes
              Last Post mangel2000  
              Started by Doxxxx, Today, 01:24 AM
              0 responses
              5 views
              0 likes
              Last Post Doxxxx
              by Doxxxx
               
              Working...
              X