Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Price has Crossed 'x' MA in past 'x' days PCF Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
jwilly333
Posted : Tuesday, February 19, 2008 7:23:04 AM
Registered User
Joined: 5/23/2005
Posts: 13
I am looking for a PCF that will identify stocks where price has crossed a designated moving average in the last 10 days, or whatever time value I select. I would like to be able to easily substitute the MA value and the historical time period. I don't particularly care if the price is moving up or down (I have a PCF that identifies the trend of the MA).

This is an example that I found, but I think I would have to replicate this many times over to achieve my objective for pricce moving up or down (plus I am not sure the result will be what I want):
Price crossing Moving Average: In last 5 days, Up, Simple (average:10)
C>AVGC10 AND (C1<AVGC10.1 OR C2<AVGC10.2 OR C3<AVGC10.3 OR C4<AVGC10.4 OR C5<AVGC10.5)


I have attempted to do this myself, but the formula seems very long and clumsy. I am willing to bet you can come up with a very compact and efficient one. If not, just let me know.
StockGuy
Posted : Tuesday, February 19, 2008 10:04:49 AM

Administration

Joined: 9/30/2004
Posts: 9,187
A PCF would be very lengthy if you were looking for crosses over the last 30 days for example.

But try this.  Add the following formula as a Custom Percent True indicator on your chart:

(C < AVGC10 and C1 > AVGC10.1) or (C > AVGC10 and C1 < AVGC10.1)

Change the 10s to whatever moving average you want.  Set the Smoothing Average on the custom indicator to the "lookback" period you want (in past x days).  Now right click on the indicator and select Sort By.  Set the sort to Actual Value.

The sort column will show a list of values.  Any stock with a value > 0.00% has crossed the average in the preceding x days.
jwilly333
Posted : Tuesday, February 19, 2008 5:14:25 PM
Registered User
Joined: 5/23/2005
Posts: 13
Thanks a lot - I will give it a try.
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.