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.
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).
0
Comments
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)]
[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.
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
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)
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) ) ]
I don't think 'range(2)' is valid. In an 'and' statement it doesn't kick out an error, but if you do
rank by range(2)
it says unrecognized characters after rank by. If you say
rank by range
it's ok with it. Also, range( ) doesn't show up as a function on the 'Technical Functions' page in the documentation. I think we've seen this before where the syntax checking is not really comprehensive.
Kindly elaborate do you mean, ATR2 < 1 day ago(min(20, ATR(2)"
and [ATR(2) <= 1 days ago Lower Price Chan(20,ATR(2))]
The Price Channel 20 on the ATR2 would show the max/ high value (Upper Price Channel) for the ATR2 in the last 20 periods, as well as the min/ lowest value (Lower Price Channel) for the ATR2
I put ATR2 and the Price Channel 20 overlay on the indicator to "check" results and thought that might be another option to use in your endevour.
@markd. I did get "results" with Range(2) but the Rank by returned Range value. I didn't think it would work either, but checking syntax accepted it but the results using ATR2 and the Price Channel, it didn't seem like the Range(2) was actually working.
That's why I suggested ATR2 as an option. It's not exactly what was requested but it could be a close enough option if the Min/Max math version doesn't work out.
Bollinger Band Squeeze is a well-known narrow range scan. Should be in the documentation.