Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ADX - Getting the highest value from the past 30 bars

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

    ADX - Getting the highest value from the past 30 bars

    Hi there,

    This is probably a very simple question, but I'd like someone to validate it for me.
    What NS code would return the highest ADX value from the past 30 bars on a chart?

    I suspect it involves using MAX and MIN, but I can't figure out what code to write.
    Thanks in advance for any help!

    - R

    #2
    Hello Spiderbird,

    Thank you for your post.

    The code would use HighestBar() to return the barsago index for the highest value of the ADX within the last 0 bars. I have listed the code below:
    Code:
    //This will print the highest value of the ADX over the last 30 bars
    Print(ADX(20)[HighestBar(ADX(20), 30)]);
    For information on HighestBar() please visit the following link: http://www.ninjatrader.com/support/h...highestbar.htm

    Please let me know if I may be of further assistance.

    Comment


      #3
      Hi Patrick,

      That did the trick! I also combined this with Slope to really pinpoint particular high points on ADX. Next step is to code a switch between ADX and ADXR (the former for shorter term high points on ADX, and the latter for trades that have been in the market for a particular duration)

      Thanks for your help!

      - Spider

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      648 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      369 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      108 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      572 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      574 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X