• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Highest of n. bars

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

    Highest of n. bars

    Hi

    I'm not sure if (pls remember i'm using Strategy Builder not coding myself) I have this condition:

    Low 0 bars ago, cross below, look back period 1, Donchian Channel 1 bar 1 lower

    I would receive a signal when the Low of this bar cross the lower limit of the Dochian channel set 1 bar ago (for what ever period I set the Donchian Channel).

    ----

    On the same topic, If I use

    Low 0 bars ago, cross below, look back period 1, Low 'n' bars ago

    the n bars ago would mean that the Prices is compared to ALL the prices included in the period from now till 'n'? or just the price of now vs THE (only) price that did happen at the close of 'n' bars ago?

    many thanks as usual
    m

    #2
    Hello percma,

    Thank you for your note.

    The n you pass to Low, for example Low[n], would be assigned an int number, for example 10. So, Low[n] would mean Low[10] or the low 10 bars ago, not everything between.

    If Low[n] was within a loop, then you could loop through everything inbetween. You could see the following post for an example of using a while loop which adds each high to a running total, highValue.

    https://ninjatrader.com/support/foru...83&postcount=2

    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thank you for your reply.
      It means I won't be able to loop through everything in between using the Strategy Builder?

      Comment


        #4
        Originally posted by percma View Post
        Thank you for your reply.
        It means I won't be able to loop through everything in between using the Strategy Builder?
        You will not be able to do so. That is the abiding weakness of all code generators: they can only generate that which the developer precodes into them.

        Comment


          #5


          but if I use a Donchian channel like this?

          Low 0 bars ago, cross below, look back period 1, Donchian Channel (n period) bar 1 ago lower

          ...i'm trying to get a signal is the price now (0 bars ago), cross below the lower level of the Donchian channel as it was 1 bar ago. (since now the lower band would be the one set by the price now).

          Comment


            #6
            Hello percma,

            Rather than using cross below, you could check if the low of the current bar is above Donchian 1 bar ago, and the low 1 bar ago was above the Donchian of that bar, which would translate into a cross.

            I attached a screen shot of how you could set this up.

            Please let us know if you need further assistance.
            Attached Files
            Alan P.NinjaTrader Customer Service

            Comment


              #7
              ok. I think what you sent was the low crossing above..but yes. I understand what you were suggesting. many thanks

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by uiwislth, Yesterday, 11:25 PM
              0 responses
              4 views
              0 likes
              Last Post uiwislth  
              Started by Steve L, Yesterday, 10:04 PM
              0 responses
              3 views
              0 likes
              Last Post Steve L
              by Steve L
               
              Started by marianfed, Yesterday, 09:47 PM
              0 responses
              4 views
              0 likes
              Last Post marianfed  
              Started by hir04068, Yesterday, 09:29 PM
              0 responses
              2 views
              0 likes
              Last Post hir04068  
              Started by iq200, 03-11-2018, 07:49 PM
              24 responses
              1,018 views
              0 likes
              Last Post mrlucky1x  
              Working...
              X