Announcement

Collapse
No announcement yet.

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 demarcog, Today, 05:40 PM
              5 responses
              19 views
              0 likes
              Last Post demarcog  
              Started by cincai, Today, 08:16 PM
              0 responses
              6 views
              0 likes
              Last Post cincai
              by cincai
               
              Started by cincai, Today, 08:04 PM
              0 responses
              1 view
              0 likes
              Last Post cincai
              by cincai
               
              Started by demarcog, Today, 06:23 PM
              0 responses
              5 views
              0 likes
              Last Post demarcog  
              Started by canliyayin, Today, 05:56 PM
              0 responses
              4 views
              0 likes
              Last Post canliyayin  
              Working...
              X