Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is MAX() function inclusive?

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

    Is MAX() function inclusive?

    Hi,

    Does:

    MAX(High,1)[1]

    Return yesterday's high, or the day before yesterday's high?

    thanks,
    RK142

    #2
    Hi RK,

    [0] is always the current bar (whether completed or not), so [1] is the prior bar. Thus, your syntax will refer to what the MAX value was 1 bar ago.

    Comment


      #3
      What coolmoss said is correct. Your calculate on bar close setting will determine if it refers to the prior bar's high or the bar before that. This would only refer to daily bars if you were currently operating on a daily chart



      If you just wanted the prior high you could use

      High[x]// where x is the bars ago value


      Let me know if I can further assist.
      LanceNinjaTrader Customer Service

      Comment


        #4
        Thank you both.

        I understand how to call the prior High, but what I'm doing is a little trickier than that, and it will help me to implement my logic if I understand whether:

        Max(High,1)[1]

        Is equivalent to

        High[1], or
        High[2].

        Which one?

        -RK142

        Comment


          #5
          In this specific case it would return the same value as High[1]

          You can confirm this by sending a print to the output window (tools -> output window)

          Print(High[1]);
          Print(Max(High,1)[1]);

          Let me know if I can further assist.
          LanceNinjaTrader Customer Service

          Comment


            #6
            Thanks!

            -RK

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            571 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            330 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
            549 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            549 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X