New Members: Be sure to confirm your email address by clicking on the link that was sent to your email inbox. You will not be able to post messages until you click that link.

2-Bar Narrow Range

Need help in scanning this query , Toby Crabel – 2-Bar Narrow Range (NR) pattern is defined as the narrowest range from high to low of any two day period relative to any two day period within the previous 20 market days (Look_Back).

Comments

  • lmkwinlmkwin ✭✭
    In ChartSchool there is an article on the Crabel NR7. Link below. There are some scan examples that you can use to find that. You should be able to modify those lines to meet your needs I think.


    https://chartschool.stockcharts.com/table-of-contents/trading-strategies-and-models/trading-strategies/narrow-range-day-nr7

    NR7 in Uptrend After Pullback
    This scan reveals stocks that have just had an NR7 day during an uptrend (as indicated by the Aroon indicator values) and whose CCI values indicate an oversold condition.

    [type = stock]
    and [country = us]
    and [daily sma(20,daily volume) > 100000]
    and [daily sma(60,daily close) > 20]
    and [Range < 1 day ago Min (6, Range)]
    and [today's high < yesterday's high]
    and [today's low > yesterday's low]
    and [Min (5, CCI(10)) < -100]
    and [Aroon Up (63) > Aroon Down(63)]
  • This seems to be valid grammatically, but it doesn't produce results. I don't know if that's because there really aren't any results, or if the logic is wrong.

    [group is sp500]
    and [[min(2,high) - max(2, low)] < min(20, min(2,high) - max(2, low) ) ]

    You could try writing it out long hand. Each time you add a new day, your get fewer results.


    and [max(2,high) - min(2, low) < 20 days ago max(2,high) - 20 days ago min(2, low) ]
    and [max(2,high) - min(2, low) < 19 days ago max(2,high) - 19 days ago min(2, low) ]
    and [max(2,high) - min(2, low) < 18 days ago max(2,high) - 18 days ago min(2, low) ]
    and ... etc.

    Or, this isn't perfect, but it's shorter and it may be a reasonable approximation.

    [group is sp500]
    //and [ATR(2) < ATR(20)*.7]

    For any solution, you might want to add a few conditions as suggested above in the previous post to minimize false hits.
  • lmkwinlmkwin ✭✭
    This also seems to "work" and get results.

    and [Range(2) < 1 day ago Min (20, Range(2))]

    I put ATR2 on the chart and a 20 Price Channel overlay on that to "test". Hey, maybe that's another way to scan perhaps

    ATR2 < than 1 days ago Lower Price Chan 20, ATR2
  • Thank you Imkwin and markd , I am overwhelmed with your response @ markd is this syntax of writing the scan correct : [group is sp500]
    and [[min(2,high) - max(2, low)] < min(20, min(2,high) - max(2, low) ) ], Kindly check this

    @ Imkwin : ATR2 < than 1 days ago Lower Price Chan 20, ATR2 Kindly elaborate do you mean, ATR2 < 1 day ago(min(20, ATR(2)
  • markdmarkd mod
    edited 8:38AM
    Sorry, wrong version. I was experimenting and gave you the version that gets hits, some of which look right, but others don't. The syntax is correct but I think the logic is wrong. It takes subtracts the higher low from the lower high. That's not the two day range.

    This is the one that I think is logically correct but doesn't get hits for the many dates I sampled. That seems improbable, so I'm not sure what's wrong. It subtracts the two day low from the two day high, which seems to be the right thing to do. However, I'm not sure whether you can really do reliable calculations inside the max and min functions, even though it passes syntax and the first version gets results. The documentation doesn't show that you can, but it doesn't say you can't, either. That might be a question for Support.

    and [max(2,high) - min(2, low) < min(20, max(2,high) - min(2, low) ) ]
Sign In or Register to comment.