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 |

How to find stocks where the 10,20,50,100 and 200 MA's are close together? Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Deion
Posted : Tuesday, July 11, 2006 10:33:48 PM
Registered User
Joined: 2/19/2006
Posts: 89
One of the best Worden Reports I have come across was by Sir Fan Trader (March 8, 2006). In the report he talks about using a fan pattern criteria (where the 10sMA>20sMA>50sMA>100sMA>200sMA.) I went back and visually looked at past occurences and the success it it is something I wish to investigate further. Craig was kind enough to help write a PCF where the fan pattern might be false one day but be true the next day.

I am trying to find a way where I can identify stocks where the MA's are very close together before the fan pattern might be true. Here goes an example: Currently ABI fits the fan pattern criteria but the MA's are vastly spread apart(the 10 SMA is well above the 200 SMA).

The pattern I am trying to identify is from ticker SLFI between the periods of 6/29/2006 to 7/3/2006. In this pattern the SMA's were very close together before the stock formed the fan pattern. Any help I can get to help me would be grealy appreciated.
diceman
Posted : Tuesday, July 11, 2006 11:38:05 PM
Registered User
Joined: 1/28/2005
Posts: 6,049
Deion

This is one way:

((ABS(AVGC10-AVGC50)+ABS(AVGC20-AVGC50)+ABS(AVGC100-AVGC50)+ABS(AVGC200-AVGC50)))/C)*100

This is all the absolute differences from the 50MAV (I picked that because it was the middle value)

This sum is divided by the Close*100 (to adjust for stock price).

Low values will be where the MAV's are close.
(since they will spread once a trend kicks in)

Thanks
Craig_S
Posted : Wednesday, July 12, 2006 6:08:28 AM


Worden Trainer

Joined: 10/1/2004
Posts: 18,819
This is how I would do it as well (use it as a SORT)

Here is my version:

100*(ABS(AVGC10-AVGC20) +ABS(AVGC10-AVGC50) +ABS(AVGC10-AVGC100) +ABS(AVGC10-AVGC200) +ABS(AVGC20-AVGC50) +ABS(AVGC20-AVGC100) +ABS(AVGC20-AVGC200) +ABS(AVGC100-AVGC50) +ABS(AVGC200-AVGC50) +ABS(AVGC100-AVGC200))/AVGC200

I looked at all of the relatsionships, simplified the parens and divided by the average 200-day price to make the divisor less volatile.

Sort any WatchList in ASCENDING order and check out the results.

- Craig
Here to Help!
bustermu
Posted : Thursday, July 13, 2006 11:16:41 AM
Registered User
Joined: 1/1/2005
Posts: 2,645
Suppose we require that the distance between any pair of the moving averages be less than say 2% of the closing price. A PCF for this is:

PCF1:
(ABS(AVGC10-AVGC20)<0.02*C)
AND (ABS(AVGC10-AVGC50)<0.02*C)
AND (ABS(AVGC10-AVGC100)<0.02*C)
AND (ABS(AVGC10-AVGC200)<0.02*C)
AND (ABS(AVGC20-AVGC50)<0.02*C)
AND (ABS(AVGC20-AVGC100)<0.02*C)
AND (ABS(AVGC20-AVGC200)<0.02*C)
AND (ABS(AVGC50-AVGC100)<0.02*C)
AND (ABS(AVGC50-AVGC200)<0.02*C)
AND (ABS(AVGC100-AVGC200)<0.02*C)

If we wish to use the summation form given by Craig above, then the PCF is:

PCF2:
(ABS(AVGC10-AVGC20)
+ABS(AVGC10-AVGC50)
+ABS(AVGC10-AVGC100)
+ABS(AVGC10-AVGC200)
+ABS(AVGC20-AVGC50)
+ABS(AVGC20-AVGC100)
+ABS(AVGC20-AVGC200)
+ABS(AVGC50-AVGC100)
+ABS(AVGC50-AVGC200)
+ABS(AVGC100-AVGC200))/4<0.02*C

Please notice the divide by 5-1 = 4 in PCF2.

If PCF2 is True then PCF1 is also, but there are many cases where PCF1 is True but PCF2 is not. The 0.02 in PCF2 is the largest value for which PCF1 is True whenever PCF2 is.

Of course, as the number of moving averges increases, the length of both PCFs becomes impractical. In that case, we would resort to a form similar to that of diceman.

Thanks,
Jim Murphy
RickD97
Posted : Thursday, October 12, 2006 11:20:25 AM
Registered User
Joined: 11/1/2004
Posts: 17
I probably have a mental block, but why are you dividing 10 items by 4 in PCF2?
diceman
Posted : Monday, October 16, 2006 8:06:55 AM
Registered User
Joined: 1/28/2005
Posts: 6,049
My original thought was 5 moving averages create
4 comparisons.

10vs20
20vs50
50vs100
100vs200

That's what I thought bustermu's reference to 5-1=4 was.

That appears not to be the case.

Thanks
diceman
bustermu
Posted : Monday, October 16, 2006 1:03:25 PM
Registered User
Joined: 1/1/2005
Posts: 2,645
QUOTE (RickD97)
I probably have a mental block, but why are you dividing 10 items by 4 in PCF2?


RickD97,

Suppose we have N numbers. Let:
1) MAX = maximum distance between any pair of the N numbers
2) SUM = sum of the distances between different pairs of the N numbers

Note: There are N*(N-1)/2 distinct pairs of N distinct numbers.

We have the inequality:

(N-1)*MAX <= SUM

or, equivalently:

MAX <= SUM/(N-1)

The equality holds when N-1 of the N numbers are the same.

Thus:

SUM/(N-1) <= d

assures that:

MAX <= d

In the example above, N = 5. Hence, the division of the sum of the distances by N-1 = 4.

Thanks,
Jim Murphy
diceman
Posted : Monday, October 16, 2006 11:42:00 PM
Registered User
Joined: 1/28/2005
Posts: 6,049
bustermu

I don't think I understand this scan.(PCF2 above)

Quote:"Suppose we require that the distance between any pair of the moving averages be less than say 2% of the closing price."

I assume that if the close was 100. We would be searching for a pair with a value of
less than two.

If we assume that one moving average pair meets the criteria and the other 9 do not.

The "best" value to meet the criteria would be zero. (the MAVs are the same)
The "best" value to fail by would be 2. (the first vale that does not meet the criteria).

If the close=100.

0+((2*9)/4)=4.5<(100*.02) (a false value for the PCF)

------------------------------------------------------------------------------------

If we assume one of the MAV differences is a (PCF true) distance of 1.5.
The other MAV distances have to be approximately 50% of that
value to give a true condition.

1.5+((9*.7)/4)=1.94<(100*.02) (just barely true)


Thanks
diceman






bustermu
Posted : Tuesday, October 17, 2006 5:17:32 AM
Registered User
Joined: 1/1/2005
Posts: 2,645
QUOTE (diceman)
Quote: "Suppose we require that the distance between any pair of the moving averages be less than say 2% of the closing price."


diceman,

I apologize. The problem may be my use of the word "any". I know very well not to use the word "any" as a synonym for "all".

The statement should read:

"Suppose we require that the distance between all pairs of moving averages be less than say 2% of the closing price."

Your next statement would then be something like:

"I assume that if the close was 100, we would be requiring that the distance between all pairs be a value less than 2."

That being said, the least value the left-side of the inequality in PCF2 can take on is the maximum distance between all pairs of the moving averages. Thus, if PCF2 returns True, the maximum distance between all pairs of the moving averages is less than 0.2*C.

As an aside, it is not possible to have five numbers with one of the distances apart = 0 and the remaining nine distances apart = 2. The point is that you cannot assign the ten distances between five numbers arbitrarily. This would lead to a misinterpretation of PCF2.

Thanks,
Jim Murphy
diceman
Posted : Tuesday, October 17, 2006 7:16:26 PM
Registered User
Joined: 1/28/2005
Posts: 6,049
bustermu

I realized I was taking some liberties with the moving
average differences. ( 0 and the rest 2 )

However if the best case (lowest value sum) did not
trigger. It was an indication that "real world" values
would only be worse.

This indicated either the intent of the PCF or my interpretation of it was wrong.

Thanks
diceman
bustermu
Posted : Thursday, October 19, 2006 8:41:26 AM
Registered User
Joined: 1/1/2005
Posts: 2,645
diceman,

I have been unable to determine your exact objections to the use of PCF2.

You appear to believe that using the sum of the distances between the moving averages as a measure of how close together they are is not completely satisfactory. If that is the case, I agree with you.

I recommend that the sum of the distances between the moving averages not be used to as such a measure. I also recommend that the sum of the distances from a particular moving average to the others not be used as such a measure. Only the maximum distance between pairs of moving averages seems to be a completely satisfactory measure of their "closeness" to one another.

Thanks,
Jim Murphy
diceman
Posted : Thursday, October 19, 2006 7:56:17 PM
Registered User
Joined: 1/28/2005
Posts: 6,049
bustermu

My original curiosity of PCF2 developed because I interpreted your statement:
"Suppose we require that the distance between any pair of the moving averages be less than say 2% of the closing price."

To mean that it would trigger true based on 1 pair of moving averages.

(Obviously that is not the case)

However there are many things that I don't like about PCF2.
(a matter of taste)

1) We must determine/define the 2% level.

2) It would seem that once we have "scanned" for low volatility. We
must now apply some measure to the stock. To determine when the
condition is changing.

3)When any true/false scan is used there is no way to "rank"
relative values.

4) Using an "analog" format we can monitor expansion/contraction
as it develops and observe historical highs/lows.


Thanks
diceman

bustermu
Posted : Friday, October 20, 2006 5:01:41 PM
Registered User
Joined: 1/1/2005
Posts: 2,645
We wish to measure the mutual proximity of the five moving averages (MAs), AVGC10, AVGC20, AVGC50, AVGC100, AVGC200. We give PCFs for three such measures. They are listed in order of their desirability which, unfortunately, is also their order of complexity. Each is given as a percent of the average of the five MAs.

PCFa:
100
*(((AVGC10>=AVGC20)*(AVGC10>=AVGC50)*(AVGC10>=AVGC100)*(AVGC10>=AVGC200)
-(AVGC10<=AVGC20)*(AVGC10<=AVGC50)*(AVGC10<=AVGC100)*(AVGC10<=AVGC200))*AVGC10
+((AVGC20>AVGC10)*(AVGC20>=AVGC50)*(AVGC20>=AVGC100)*(AVGC20>=AVGC200)
-(AVGC20<AVGC10)*(AVGC20<=AVGC50)*(AVGC10<=AVGC100)*(AVGC10<=AVGC200))*AVGC20
+((AVGC50>AVGC10)*(AVGC50>AVGC20)*(AVGC50>=AVGC100)*(AVGC50>=AVGC200)
-(AVGC50<AVGC10)*(AVGC50<AVGC20)*(AVGC50<=AVGC100)*(AVGC50<=AVGC200))*AVGC50
+((AVGC100>AVGC10)*(AVGC100>AVGC20)*(AVGC100>AVGC50)*(AVGC100>=AVGC200)
-(AVGC100<AVGC10)*(AVGC100<AVGC20)*(AVGC100<AVGC50)*(AVGC100<=AVGC200))*AVGC100
+((AVGC200>AVGC10)*(AVGC200>AVGC20)*(AVGC200>AVGC50)*(AVGC200>AVGC100)
-(AVGC200<AVGC10)*(AVGC200<AVGC20)*(AVGC200<AVGC50)*(AVGC200<AVGC100))*AVGC200)
/((AVGC10+AVGC20+AVGC50+AVGC100+AVGC200)/5)

This is the maximum distance between pairs of MAs as a percent of the average of the MAs.

PCFb:
100
*(ABS(AVGC10-AVGC20)+ABS(AVGC10-AVGC50)+ABS(AVGC10-AVGC100)+ABS(AVGC10-AVGC200)
+ABS(AVGC20-AVGC50)+ABS(AVGC20-AVGC100)+ABS(AVGC20-AVGC200)
+ABS(AVGC50-AVGC100)+ABS(AVGC50-AVGC200)
+ABS(AVGC100-AVGC200))
/(4*(AVGC10+AVGC20+AVGC50+AVGC100+AVGC200)/5)

This is the sum of distances between distinct pairs of MAs divided by 5-1 = 4 as a percent of the average of the MAs.

PCFc:
100
*(ABS(AVGC10-AVGC20)+ABS(AVGC10-AVGC50)+ABS(AVGC10-AVGC100)+ABS(AVGC10-AVGC200))
/((AVGC10+AVGC20+AVGC50+AVGC100+AVGC200)/5)

This is the sum of the distances from the first MA to the remaining MAs as a percent of the average of the MAs.

The following inequalities hold:

PCFa <= PCFb <= PCFc
PCFb <= (6/4)*PCFa
PCFc <= 4*PCFa

These inequalities account for the order of desirability of the PCFs.

Thanks,
Jim Murphy
diceman
Posted : Friday, October 20, 2006 11:06:43 PM
Registered User
Joined: 1/28/2005
Posts: 6,049
bustermu

I like the form of PCFa.

However there seem to be conditions that cause large indicator spikes.

See symbols: IBM and GM in the MARCH-APRIL 06 period.

Thanks
diceman
bustermu
Posted : Saturday, October 21, 2006 9:22:18 AM
Registered User
Joined: 1/1/2005
Posts: 2,645
diceman,

Thanks for finding my error. I will post an Errata and hopefully PCFa will be fixed.

Thanks,
Jim Murphy
bustermu
Posted : Saturday, October 21, 2006 9:47:04 AM
Registered User
Joined: 1/1/2005
Posts: 2,645
Errata:

In PCFa, the line:

-(AVGC20<AVGC10)*(AVGC20<=AVGC50)*(AVGC10<=AVGC100)*(AVGC10<=AVGC200))*AVGC20

should read:

-(AVGC20<AVGC10)*(AVGC20<=AVGC50)*(AVGC20<=AVGC100)*(AVGC20<=AVGC200))*AVGC20

The last two AVGC10's should be changed to AVGC20's.

Sorry,
Jim Murphy



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.