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.
Trading In TOP Half of the Range
Hello need help in scanning as in the image attached . I want a scan for stocks which are trading in the top half of the 52-week or 3-months range for atleast 5-days. I have marked the zones and coloured them accordingly Blue Zone : 100% Green Zone:50% and Below 50 I have coloured Red Zone. Please if anyone could guide me with the scanner
0
Comments
and [min(5, Fast Stoch %K(250,1)) > 50]
Top half of 63 day (quarterly - 250/4 = 62.5) range
and [min(5, Fast Stoch %K(63,1)) > 50]
This doesn't account for where they have been, only where they are now. So they could be coming down from higher levels toward 50, or rising from below 50.
You might be interested in my response to your query about scans I use. I couldn't reply right away, but I did respond:
https://scan.stockcharts.com/discussion/2851/williams-fractals#latest
and [sma(3,range) < sma(20, range) * .5]
That says the three day average range is less than half the 20 day average range.
Or maybe
and [max(3, range) < sma(20, range) *.25]
meaning, the best range over the last three days is less than one quarter the 20 day average range.
You could play around with the numbers (3, 20, .5, .25) to see what works.
Another possibility:
and [max(3,range) < 4 days ago min(10,range)]
Also play with the numbers for this one.
Testing for the bodies is more complex because you have to account for possible negative numbers when you subtract close and open.
//// Universe of stocks
[
// [group is ETF]
[exchange is NYSE]
or [group is SP500]
or [group is SP100]
or [group is SP400]
or [group is SP600]
or [group is NASDAQ100]
or [group is DOW30]
or [group is DOW65]
]
and [sma(20,volume) > 500000]
and [5 days ago close > AbsVal(Max(250) + MIN(250)) / 2]
and [4 days ago close > AbsVal(Max(250) + MIN(250)) / 2]
and [3 days ago close > AbsVal(Max(250) + MIN(250)) / 2]
and [2 days ago close > AbsVal(Max(250) + MIN(250)) / 2]
and [1 days ago close > AbsVal(Max(250) + MIN(250)) / 2]
and [close > AbsVal(Max(250) + MIN(250)) / 2]
This scan yielded a whopping 906 stocks that have closed in the upper half for the last 5 days! To whittle that down, instead of dividing the MAX/MIN sum by 2, use 1.75 or 1.50, for example, which will result in a larger percentage of the range and net fewer stocks above the midpoint. Using a divisor of 1.5 netted me 17 stocks, all of which are very near their 52-week highs. Using 1.75 as a divisor netted 236, and 1.60 netted 54. So you can adjust the divisor to get more or less stocks as a result. Just keep the divisor no higher than 2 to ensure that all the returns will be in the upper half of the MAX/MIN period. To see a 3 month period, just change the MAX/MIN periods to 63, one month to 2, 6 months to 126 and so on.
Your second question about scanning for small body candles is doable like this:
//// Universe of stocks
[
// [group is ETF]
[exchange is NYSE]
or [group is SP500]
or [group is SP100]
or [group is SP400]
or [group is SP600]
or [group is NASDAQ100]
or [group is DOW30]
or [group is DOW65]
]
and [SMA(20, Volume) > 500000]
and [AbsVal(open - close) <= .3 * ATR(14)]
and [AbsVal(yesterdays open - yesterdays close) <= .3 * ATR(14)]
and [AbsVal(2 days ago open - 2 days ago close) <= .3 * ATR(14)]
and [AbsVal(3 days ago open - 3 days ago close) <= .3 * ATR(14)]
and [AbsVal(4 days ago open - 4 days ago close) <= .3 * ATR(14)]
and [AbsVal(5 days ago open - 5 days ago close) <= .3 * ATR(14)]
You can vary to ATR multiplier and period to your choice. This scan yielded 15 stocks. When I commented
out the last statement, I got 22 stocks, and commenting out the last 2 statements got 35. This is an interesting scan, and certainly calls attention to stocks that are at a 'decision point'. I plan to make use of this one to see how it pans out.