Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Lower highs/Lower Lows

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

    Lower highs/Lower Lows

    I am working on a strategy that tests for Lower Highs and Lower lows for consecutive days.

    Currently i set it up to calculate based on checking each manually

    && High[2] < High[3]
    && Low[
    2] < Low[3]
    && Low[
    1] < Low[2]
    && High[
    1] < High[2]
    && High[
    0] < High[1]
    && Low[
    0] < Low[1])

    Is there anyway I could have this process calculate based on number of days?

    My goal is to use the optimizer on the number of days of consecutive lower lows or lower highs, but I can't optimize if I use this hard logic and don't have a parameter/variable that denotes # of days of this behavior.

    Thanks for all your help on all my questions



    #2
    Hi dirygoatee,

    There are built in methods that can make these types of conditions easier to work with. Please have a look at nbarsDown and nBarsUp.


    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Ryan, thank you for your response. I played with the NBar method, however I don't want any logic related to the close. My goal is reference only the highs and lows. Can the NBar reference only the high and low and ignore the close?

      I used the statement below and set the bool's on the High and Low to true, but it still seems to force a lower close

      NBarsDown(barCount, false, true, true)[0] == 1

      Comment


        #4
        dirygoatee, can you try for your logic for example this call :

        NBarsDown(High, barCount, false, true, true)[0] == 1

        This would force the input series to be the High series.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X