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

&& (MAX(High, 4)[0] <= Swing ().SwingHigh[0])

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

    && (MAX(High, 4)[0] <= Swing ().SwingHigh[0])

    last 4 bar's high's can't break "above" or "equal" the swing() high
    Code:
    [SIZE=2][FONT=Courier New]&& (MAX(High, [/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800080]4[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2])[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]] <= Swing ().SwingHigh[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]])[/SIZE][/FONT]
    trying to make it say...

    Code:
    there can't be less than 4 bars and more than 15 bars with a High <=  current or last Swing ().SwingHigh[0])
    Last edited by duck_CA; 03-17-2009, 03:45 AM. Reason: correction

    #2
    duck_CA,

    Sorry, I do not follow what you want to do from the English statement. Please clarify what less than 4 and greater than 15 means. Are these bars ago ranges?
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      bars ago

      hey josh

      yes i was referring to bars ago for both 4 and 15...

      thanks

      Comment


        #4
        MAX(High, 4)[0] and MAX(High, 11)[4] would get you that range I believe.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          MAX(High, 11)[4]

          it worked... thanks josh.

          can you explain the int[4] and what it is saying?

          I understand the (High,11)[4]=15 bars

          Comment


            #6
            [4] means start at 4 bars ago. Then the period of 11 brings it back to 15 bars from the starting location of 0 bars ago.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              ah...thanks josh

              i will include that with my growing collection of notes

              Comment


                #8
                oops

                originally had:
                there can't be less than 4 bars and more than 15 bars with a High <= current or last Swing ().SwingHigh[0])

                was trying to say:
                there can't be less than 4 bars and no more than 15 bars with a High <= current or last Swing ().SwingHigh[0])

                sorry josh

                Comment


                  #9
                  duck_CA,

                  Not sure what that means. Less than 4 total bars that have highs that are <= current/last swing? Please clearly state out the exact conditions.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    less than 4 bars...but no more than 15 bars

                    trying to "narrow down" this filter by saying:
                    Code:
                    <4 bars but no more than 15 bars
                    so any bars between bar #4 and #15 would be considered. hope that clears

                    Comment


                      #11
                      Originally posted by duck_CA View Post
                      trying to "narrow down" this filter by saying:
                      Code:
                      <4 bars but no more than 15 bars
                      so any bars between bar #4 and #15 would be considered. hope that clears

                      if(MAX(High,4)[0] < Swing().SwingHigh[0]
                      && MAX(High,16)[0] >= Swing().SwingHigh[0])

                      Comment


                        #12
                        i'll give it a shot...thank you

                        thanks Roonius

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Salahinho99, 05-05-2024, 04:13 AM
                        6 responses
                        54 views
                        0 likes
                        Last Post Salahinho99  
                        Started by knighty6508, 05-10-2024, 01:20 AM
                        4 responses
                        26 views
                        0 likes
                        Last Post knighty6508  
                        Started by OllieFeraher, 05-09-2024, 11:14 AM
                        6 responses
                        19 views
                        0 likes
                        Last Post OllieFeraher  
                        Started by PaulMohn, 05-02-2024, 06:59 PM
                        2 responses
                        44 views
                        0 likes
                        Last Post PaulMohn  
                        Started by ETFVoyageur, Today, 02:10 AM
                        0 responses
                        17 views
                        0 likes
                        Last Post ETFVoyageur  
                        Working...
                        X