Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Return Indexies from MAX, MIN

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

    Return Indexies from MAX, MIN

    I know that this problem is possible using a loop. But, it seems that there should be a more elegant solution.

    The MAX or MIN Ninjascript functions return the maximum or minimum values of a dataseries N bars ago. So, MAX(High,20)[0] will return the current highest high within 20 bars, correct?

    I want to find the low of that highest high. So, say if the highest high occured 10 bars ago, I want to know the value of Low[10]. The MAX and MIN functions must contain some sort of looping logic. Is there any way I can get the 10 out of there functions?

    #2
    Hello Serac,
    Thanks for your post and I am happy to assist you.

    Please use the following snippet
    Code:
    Low[HighestBar(High, 7)]
    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    576 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