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 chbruno, Today, 04:10 PM
              0 responses
              3 views
              0 likes
              Last Post chbruno
              by chbruno
               
              Started by josh18955, 03-25-2023, 11:16 AM
              6 responses
              436 views
              0 likes
              Last Post Delerium  
              Started by FAQtrader, Today, 03:35 PM
              0 responses
              6 views
              0 likes
              Last Post FAQtrader  
              Started by rocketman7, Today, 09:41 AM
              5 responses
              19 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by frslvr, 04-11-2024, 07:26 AM
              9 responses
              127 views
              1 like
              Last Post caryc123  
              Working...
              X