Scan for stocks under 21 day EMA


Category:
0
0

Hello guys,

I’m uploading a screenshot after trying to figure this out on TOS scanner.
I basically want to find stocks that are at or under 21ema on daily charts)
I tried creating a scanner but I don’t know what I did wrong.

Also is there a way to find stocks that have been under 21ema for two consecutive days?
This is beyond my understanding in terms of creating a scanner.

Please have a look.

Thank you.

Attachments:
Marked as spam
Posted by (Questions: 3, Answers: 2)
Asked on May 18, 2020 1:32 am
287 views
1
Private answer

I see two items that may be preventing the scan from returning the results you expect.

First, notice the prefilters you are using. Buy the time you get to the third stock filter "Volume Greater Than 1,000,000" you are already down to only 14 stocks. (the value at the far right-hand side of the volume fiilter). So right there you have a major problem. You are only scanning from among a list of 14 stocks AT THAT VERY POINT.

Then you add the ATR filter, which is completely inappropriate. ATR value greater than 5. This will only be true for a very small number of stocks. Stock with the highest current price and high volatility. So that right there probably reduces your pool of potential stocks to zero. ATR filters should only be applied as a percent of ATR and never as a fixed value.

Now we finally get to your study filter for the 21 period EMA. There are no stocks left to scan before we even get to this point. So fixing this will still not give you any results. You need to go back and fix everything that comes before it before you can hope for a solution. Which is that you should not be using "PriceType.LAST", ever, for anything. As in, no one should ever use that. Ok, there may be one or two valid uses for that. But 99.9% of folks will never encounter them.

So here is the correct form of that 21 period EMA study filter:

close is less than or equal to MovAvgExponential("length" = 21)."AvgExp"

But you need to trash everything that comes before it. Start with this, then only add the bare minimum of prefilters required to narrow your scope.

If you want to include a filter for volume, don't use a fixed value. You should be using a filter that uses Daily Average Volume. Such as, today's volume is greater than average... or less than average.... or average daily volume is greater than some fixed value. But volume by itself is not the way to apply that.

If you want to use an ATR value as a filter, you need to ask yourself what the ATR is telling you. It is "Average True Range". Is today's range greater than average, or is it less than average. The former will tell you that ranges are expanding and the latter will tell you ranges are contracting. So make sure you understand what something is before you just throw it into the scan criteria.

In closing, you thought you had a problem with the 21 period EMA study filter. No, you had a problem with almost every component of your scan.

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on May 18, 2020 10:19 am
0
Thank you. I worked it out with your help. By the way, this was done early in the morning, so 1M on volume would've been too much at that time. I usually use the scan function for nightly scan (I don't know when TOS clock resets) but after a certain point it doesn't reflect yesterday's volume at closing. That's great point you made about "Average Daily Volume". Yes, I'm familiar with ATR, it fluctuates and it gets greater with volatility. Since I'm not adept at building a scanner on TOS I usually trade options with underlying stocks whose daily moves are bigger than $5, I pick scan condition ATR >= 5. Also, after reading your post, I tried looking for a way to scan for ATR % change but didn't find a way. I will try again. Thanks for the help.
( at May 18, 2020 10:48 pm)