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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        47 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        15 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        21 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        23 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X