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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        67 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        36 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        59 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        53 views
        0 likes
        Last Post CarlTrading  
        Working...
        X