Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is bad to use Max HighestBar[]

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

    Is bad to use Max HighestBar[]

    Is too bad to use the tow function to get the index of max value.....
    I was crazy to deal with this problem ..
    for examples:
    calculating the highest value on the 20 consequtive bars in the range from the 4th to the 23rd index inclusive on the current chart
    IN MT4 is very simple just like this
    val=High[iHighest(NULL,0,MODE_HIGH,20,4)];


    But ninja can't do this ,
    Max() only get value ,can't index
    HighestBar() only from CurrentBar ,can't from 4th Bar ago...

    #2
    Welcome to our forums dsin51, perhaps I'm not following you here but the MAX() method would return a dataseries that could apply indexing on as needed : http://www.ninjatrader.com/support/h...aximum_max.htm

    For example : double value = MAX(High, 20)[4];

    Comment


      #3
      Maybe my bad English made you Misunderstanding
      I know this method of the Max , and this can get the value of max
      but can't get the index of max value ,how many bars far away from currentbar found the max value.
      it is very import using : I want not only the max value ,but the bars near by the max value what has happen .

      Comment


        #4
        Thanks much for the clarification, you're correct then you would need to work with HighestBar, but it would only work from the CurrentBar backwards over the entered lookback period per default.

        Comment


          #5
          Originally posted by dsin51 View Post
          Is too bad to use the tow function to get the index of max value.....
          I was crazy to deal with this problem ..
          for examples:
          calculating the highest value on the 20 consequtive bars in the range from the 4th to the 23rd index inclusive on the current chart
          IN MT4 is very simple just like this
          val=High[iHighest(NULL,0,MODE_HIGH,20,4)];


          But ninja can't do this ,
          Max() only get value ,can't index
          HighestBar() only from CurrentBar ,can't from 4th Bar ago...
          It looks like you may have to write a for loop to do it for you.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          671 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          379 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          111 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          575 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          582 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X