Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Most recent new low

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

    Most recent new low

    Good afternoon,

    I am trying to find the most recent "new low" in a given range.

    I have been using

    lowestPrice = MIN(Low, Lookback)[0];

    this gives me the absolute low in the given range.

    I would like to find the most recent low of a candle whos Low is less then the prior candle; in the last X amount of candles.

    The look back period is dynamic so I am not sure which way to approach this be cause I can't just ask if (Low[1] < Low[2] ... ) because the lookback period could be 5 or 500 days.

    Hope this makes sense and thank you very much in advance for any help.

    Ryan


    #2
    Hi Ryan, thanks for posting.

    You would get the bar number of the Low value that you want first. There's an example of doing this here:

    I need to find the lowest bar within a range for ex: from index 2 to index 8 and current bar index is 0. I couldn't use LowestBar() method since it by default takes into account starting index as 0. Please suggest which method can be used in this situation ?


    Then you would use lowestPrice = MIN(Low, BarsArray.Count)[lowbarsAgo] to find the lowest value beyond that point. When you give MIN a previous index the function will start at that point in the price array.

    Kind regards
    -ChrisL


    Comment


      #3
      Thanks for the reply Chris, If I understand correctly, yes I have the lookback window defined. I have attached a picture of an example of the defined lookback period with an arrow of the bar I want to identify. However the bar that I want to identify is not the lowest bar in that lookback period, it is the most recent bar whose Low is lower then the previous bar. Thanks again for your help and sorry if I am misunderstanding your post or the example post.

      Comment


        #4

        Comment


          #5
          Hi, thanks for the follow up.

          There could be several ways of doing it. It's all possible with C# programming and using the price series arrays to evaluate the prices of the series. One way to do it would be to keep track of each bar update:
          private int savedBar;
          Code:
          //in OnBarUpdate:
          if(CurrentBar < 2) return;
          
          if(Low[1] < Low[2] && Low[1] < Low[0])
          {
              Draw.Dot(this, "markedBar", false, 1, Low[1]-TickSize*2, Brushes.Red);
              savedBar = CurrentBar-1;
          }
          You can use savedBar in later bars to reference the price with
          Code:
          var x = Close.GetValueAt(savedBar);
          or
          Close[CurrentBar - savedBar];

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          577 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          334 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          553 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X