Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Close touching a moving average Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
trader2
Posted : Tuesday, February 22, 2005 6:49:39 PM
Registered User
Joined: 1/30/2005
Posts: 9
Is it possible to set up a scan showing when a close touches a moving average?
Doug_H
Posted : Tuesday, February 22, 2005 8:14:47 PM


Worden Trainer

Joined: 10/1/2004
Posts: 4,308
Sure! You can use the following PCF:

C = AVGC50

This would be for a 50 bar moving average. If you want a different MA, just change the 50 in the formula to whatever period your moving average is.

Since this is just one condition, you don't even need to use a scan. You simply need to use it to sort any list of stocks. Any that return true will have closed at the moving average.

If you don't know how to enter an update a PCF, you can watch the following training video to learn how.

How to create a Personal Criteria Forumula (PCF)

Another way to find stocks that have closed at the moving average is to use visual difference sorts. Here is another video that demonstrates this technique.

Comparing indicators using Visual Difference sorts

- Doug
Teaching Online!
Tanstaafl
Posted : Wednesday, February 23, 2005 9:21:25 AM
Registered User
Joined: 10/7/2004
Posts: 799
Location: Duluth, GA
Hi, trader2:

You might also want to consider "near enuf" touches. This concept is valuable for lots of trading logic, since exact equivalencies are often unnecessary to satisfy the rule you are trying to apply. For instance, if you are looking at a chart and not at a table, your eye will pick out cases of "closing on the moving average" that are not precise, but that you will be fully satisfied to work with.

So, how close is "near enuf"? I've often found it useful to define that as a function of intraday volatility ... that is, how wiggly the bar tends to be. The following PCF will give you a "hit" any time the difference between the Close and a 50-day moving average is within one-tenth of the typical H-L daily range for that stock:

Abs(C-AvgC50) < (AvgH10-AvgL10)/10

Give it a try! Assign the "pure equality" PCF that Doug provided above (which is the precise and correct answer to your question, btw :~) to one Watchlist tab column, and assign the PCF I am showing here to an adjacent WL tab column. Use the Russell 3000 Watchlist. Sort by the "Pure" PCF, and note how many True's you get. Now sort by the "Near Enuf" PCF and you'll get a lot more hits.

Finally, use the spacebar to go thru the Near Enuf charts to see if, in fact, the extra hits are "near enuf". If not, then adjust the final /10 denominator to be a smaller value and try again.

Alternatively, if you'd like to find your "comfort zone", you might rearrange the PCF to REPORT what fraction of the average daily range is, for the various cases. That is, the PCF:
(AvgH10-AvgL10)/Abs(C-AvgC50)
will show you how far away the Close is from the AvgC50 ... now you can put that in a WL tab column, sort on it so the smallest values are on top, and start spacebarring down to find where the "near enuf" visual breakpoint is. The value in the WL tab column for that point becomes the denominator in place of the /10 that I used originally.

I hope this gives you some ideas that will help, either with your immediate task, or with other things in the future.

Jim Dean


Tanstaafl
Posted : Wednesday, February 23, 2005 9:23:34 AM
Registered User
Joined: 10/7/2004
Posts: 799
Location: Duluth, GA
oops ...my last step is backwards ... you should sort so the LARGEST values are on top (i.e the BIGGEST potential denominators). Sorry bout that!

Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.