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

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

        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.
            BertrandNinjaTrader Customer Service

            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
                  BertrandNinjaTrader Customer Service

                  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
                        BertrandNinjaTrader Customer Service

                        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 junkone, Today, 11:37 AM
                          2 responses
                          15 views
                          0 likes
                          Last Post junkone
                          by junkone
                           
                          Started by frankthearm, Yesterday, 09:08 AM
                          12 responses
                          44 views
                          0 likes
                          Last Post NinjaTrader_Clayton  
                          Started by quantismo, 04-17-2024, 05:13 PM
                          5 responses
                          35 views
                          0 likes
                          Last Post NinjaTrader_Gaby  
                          Started by proptrade13, Today, 11:06 AM
                          1 response
                          7 views
                          0 likes
                          Last Post NinjaTrader_Clayton  
                          Started by love2code2trade, 04-17-2024, 01:45 PM
                          4 responses
                          36 views
                          0 likes
                          Last Post love2code2trade  
                          Working...
                          X