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 kaywai, 09-01-2023, 08:44 PM
              5 responses
              601 views
              0 likes
              Last Post NinjaTrader_Jason  
              Started by xiinteractive, 04-09-2024, 08:08 AM
              6 responses
              22 views
              0 likes
              Last Post xiinteractive  
              Started by Pattontje, Yesterday, 02:10 PM
              2 responses
              16 views
              0 likes
              Last Post Pattontje  
              Started by flybuzz, 04-21-2024, 04:07 PM
              17 responses
              230 views
              0 likes
              Last Post TradingLoss  
              Started by agclub, 04-21-2024, 08:57 PM
              3 responses
              17 views
              0 likes
              Last Post TradingLoss  
              Working...
              X