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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        55 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        142 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        160 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        96 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        276 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X