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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      157 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      91 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      143 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      130 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      107 views
      0 likes
      Last Post CarlTrading  
      Working...
      X