#### Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

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.
Options

# Scanning for moving average Candidates

Hi Guys!

Trying to find stocks that have been hugging (+/- 5%) their Descending 50 day moving average, for past 3 months. Is This Do-able?

Also, trying to find stocks with 50 day m.a. 15% lower than it was 6 months ago. Does anybody know, how to do either one of these or Both?

## Comments

• Options
Like, a 50 day moving average that's descending 10%. The stock, Ideally, was 5% or less Below the m.a. 3 months ago(, two months ago,) and Today.
• Options
✭✭
You may want to look at weekly or monthly data to accomplish this. You can do it with daily data but you would need to put a 'test' for the condition in for each day. You'd also need to determine whether to use highs or lows or closes.

and close >= sma50 * 0.95 and close <= sma50 * 1.05
and 1 days ago close >= 1 days ago sma50,close * 0.95 and 1 days ago close <= 1 days ago sma50 * 1.05
and 2 days ago close >= 2 days ago sma50,close * 0.95 and 2 days ago close <= 2 days ago sma50,close * 1.05
and 3 days ago close >= 3 days ago sma50,close * 0.95 and 3 days ago close You could also use the MA envelopes instead. These plot a line equidistant from the MA line at whatever percentage you desire. MA Envelopes only use the close value though.

and close >= Lower MA Env(20,5) and close <= Upper MA Env(20,5)
and 1 days ago close >= 1 days ago Lower MA Env(20,5) and 1 days ago close <= 1 days ago Upper MA Env(20,5)
and 2 days ago close >= 2 days ago Lower MA Env(20,5) and 2 days ago close <= 2 days ago Upper MA Env(20,5)

etc

To get the falling you could use the PctChg function. It defaults in like this

and [PctChange(10,close) > 10]

This compares two things. In this case the current close vs the close 10 periods ago is greater than 10%

you can add the days ago (or weeks or months) into the equation to look at the percent difference between 50 days ago sma50 and the current sma50 and set the percentage to < 0

and [PctChange(50,sma50) < 0]

to use the weekly or monthly data you'd add the modifer

and [weekly PctChange(10,weekly sma10) < 0]

To look at 15% change from 6 months ago you could

and [weekly PctChange(26,weekly sma10 < -15]

I freehanded most of the scan terms. You would select them from the Technical Attributes dropdown on the workbench and add them to your scan to get the proper formats.

If you get stuck, post what you have for further trouble shooting.

• Options
Dayumm you the Man! haven't ran these yet, but looks good so far. I owe you a beer hahahaha
Sign In or Register to comment.