Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

HighestBar function

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

    HighestBar function

    Hi I need to use HighestBar function but from 10 bars ago period. I know that HighestBar and LowestBar only works from lastest bar. For example, It would be as following but obvious it will not work...

    HighestBar(Close, 100)[10]

    thanks and happy holydays for all the NT support team.

    #2
    Originally posted by fercho View Post
    Hi I need to use HighestBar function but from 10 bars ago period. I know that HighestBar and LowestBar only works from lastest bar. For example, It would be as following but obvious it will not work...

    HighestBar(Close, 100)[10]

    thanks and happy holydays for all the NT support team.
    What is the end point goal for using the function? There may be better choices.

    Comment


      #3
      HighestBar

      Hi Konagam, thanks for reply.

      well just reading MAX function and asking my self if it can works the same.

      Regards.

      Comment


        #4
        Hello,

        Correct HighestBar doesn't maintain a DataSeries to reference values from previous bars. However MAX does as you mentioned.

        -Brett
        BrettNinjaTrader Product Management

        Comment


          #5
          Adapt Code For Lowest High and Highest Low

          Originally posted by NinjaTrader_Brett View Post
          Hello,

          Correct HighestBar doesn't maintain a DataSeries to reference values from previous bars. However MAX does as you mentioned.

          -Brett
          Hi Brett,

          Can this code be modified to plot a moving channel line on the highest low and the lowest high of a certain number of bars such as 10?

          Thanks for the help,
          DT12

          Comment


            #6
            DT12, welcome to our forums - would suggest to check into the per default with NT supplied Donchian Channel indicator for that purpose.

            Comment


              #7
              Originally posted by NinjaTrader_Bertrand View Post
              DT12, welcome to our forums - would suggest to check into the per default with NT supplied Donchian Channel indicator for that purpose.
              Thanks Bertrand. I will try that.
              Last edited by DayTrader12; 10-18-2014, 12:18 AM. Reason: spelling

              Comment


                #8
                Convert Donchian Indicator To Strategy

                Originally posted by NinjaTrader_Bertrand View Post
                DT12, welcome to our forums - would suggest to check into the per default with NT supplied Donchian Channel indicator for that purpose.
                Hi Bertrand,

                I put the Donchian channel indicator on my chart, and then I tried to convert it into a strategy. I used the wizard, but no trades were generated. I made the condition for entry if the close of 1 bar ago crossed above the upper channel, then buy next bar at market. For the short, if the close of 1 bar ago crossed below the lower channel, then sell short at market. No trades on either strategy generated. I used a 12 tick stop and a 36 tick profit target on both.
                What did I do wrong?
                Thanks again for the help,
                DT12
                Last edited by DayTrader12; 10-18-2014, 12:44 AM. Reason: spelling

                Comment


                  #9
                  DT12, I would expect that with the CrossAbove / Below used, as you would compare to the Current bar value which would include the updated Donchian Value, so the crossing could never really be seen. As you would need to compare the cross to the prior Donchian value. I've attached a little example as courtesy that should be showing the signals you seeked.
                  Attached Files

                  Comment


                    #10
                    Thanks Bertrand, I will try that.

                    Comment


                      #11
                      Can I Use The Mean Of The Donchian Channel As A Trail Stop?

                      Hello Bertrand,

                      Now I have the buy and sell signals, thank you very much.
                      How do I tell Ninja Trader to use the Mean for a trail stop in my strategy?

                      Thanks again,
                      DT12

                      Comment


                        #12
                        DT12, sure attached is a little modification that would use the mean as trailing stop, it adds a tick as offset here in the hopes to not being stopped out premature on an exact test.
                        Attached Files

                        Comment


                          #13
                          Thank you Bertrand. I really appreciate the help.
                          Have a great day,
                          DT12

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                          0 responses
                          649 views
                          0 likes
                          Last Post Geovanny Suaza  
                          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                          0 responses
                          370 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by Mindset, 02-09-2026, 11:44 AM
                          0 responses
                          109 views
                          0 likes
                          Last Post Mindset
                          by Mindset
                           
                          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                          0 responses
                          574 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by RFrosty, 01-28-2026, 06:49 PM
                          0 responses
                          576 views
                          1 like
                          Last Post RFrosty
                          by RFrosty
                           
                          Working...
                          X