Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 louiseruch, Today, 01:11 AM
      0 responses
      1 view
      0 likes
      Last Post louiseruch  
      Started by kujista, Today, 12:39 AM
      0 responses
      3 views
      0 likes
      Last Post kujista
      by kujista
       
      Started by tonynt, 05-21-2019, 06:27 AM
      11 responses
      535 views
      1 like
      Last Post NinjaTrader_Jason  
      Started by fitspressotablettry, Today, 12:36 AM
      0 responses
      1 view
      0 likes
      Last Post fitspressotablettry  
      Started by Lancer, 01-29-2020, 10:15 PM
      7 responses
      469 views
      1 like
      Last Post NinjaTrader_Jason  
      Working...
      X