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 ageeholdings, Today, 07:43 AM
      0 responses
      9 views
      0 likes
      Last Post ageeholdings  
      Started by pibrew, Today, 06:37 AM
      0 responses
      4 views
      0 likes
      Last Post pibrew
      by pibrew
       
      Started by rbeckmann05, Yesterday, 06:48 PM
      1 response
      14 views
      0 likes
      Last Post bltdavid  
      Started by llanqui, Today, 03:53 AM
      0 responses
      7 views
      0 likes
      Last Post llanqui
      by llanqui
       
      Started by burtoninlondon, Today, 12:38 AM
      0 responses
      12 views
      0 likes
      Last Post burtoninlondon  
      Working...
      X