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 inanazsocial, Today, 01:15 AM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by rocketman7, Today, 02:12 AM
      0 responses
      10 views
      0 likes
      Last Post rocketman7  
      Started by dustydbayer, Today, 01:59 AM
      0 responses
      1 view
      0 likes
      Last Post dustydbayer  
      Started by trilliantrader, 04-18-2024, 08:16 AM
      5 responses
      23 views
      0 likes
      Last Post trilliantrader  
      Started by Davidtowleii, Today, 12:15 AM
      0 responses
      3 views
      0 likes
      Last Post Davidtowleii  
      Working...
      X