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

Highest value???

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

    Highest value???

    I'm having a complete mind blank today, hope someone can help

    How do I find what the highest value of say Donchian Channel Upper over the past 12 bars?

    Thanks in advance!

    #2
    Hi John833,

    Thank you for your post.

    You can use the class HighestBar(), for example...

    HighestBar(High, 12);

    More info at - http://www.ninjatrader-support.com/H...tml?HighestBar
    TimNinjaTrader Customer Service

    Comment


      #3
      do you mean

      DonchianChannel (18).Upper[(HighestBar(DonchianChannel(18).Upper, 12)]

      I've tried this and for some reason it returns the value of the Highest Bar not the Highest Value of the DC upper over the past 12 bars...

      have I written the wrong code?
      Last edited by John833; 02-25-2010, 07:34 AM.

      Comment


        #4
        HI John833,

        I see...please try the following, which I have tested and seems to calculate the value correctly.

        PHP Code:
        double DC DonchianChannel(18).Upper[(HighestBar(DonchianChannel(18).Upper12))];
        Print(
        DC); 
        TimNinjaTrader Customer Service

        Comment


          #5
          Hi Tim,

          Sorry there was a typo in my line of code, but I have exactly the same code as you and it still seems to return the value of the highest bar instead of the DC value.

          Are you sure your code returns the correct value?

          Comment


            #6
            Hi John833,

            Yes, for example, as of 9:00am EST on an ES 30 minute chart I show a value of 1103.50.
            TimNinjaTrader Customer Service

            Comment


              #7
              ok thanks

              I try from a different approach

              High[(HighestBar(High, 30))]

              maybe making it simpler may help...

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by warreng86, 11-10-2020, 02:04 PM
              5 responses
              1,357 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by Perr0Grande, Today, 08:16 PM
              0 responses
              3 views
              0 likes
              Last Post Perr0Grande  
              Started by elderan, Today, 08:03 PM
              0 responses
              5 views
              0 likes
              Last Post elderan
              by elderan
               
              Started by algospoke, Today, 06:40 PM
              0 responses
              10 views
              0 likes
              Last Post algospoke  
              Started by maybeimnotrader, Today, 05:46 PM
              0 responses
              12 views
              0 likes
              Last Post maybeimnotrader  
              Working...
              X