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

Weekly Simple Moving Average Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
joemar1961
Posted : Saturday, January 12, 2008 3:15:43 PM
Gold Customer Gold Customer

Joined: 7/26/2007
Posts: 26
I need help writing a PCF for a simple moving average condition in the weekly timeframe.
I need a 20MA above 20MA one week ago.
Thank you,
Joe
adina63
Posted : Saturday, January 12, 2008 8:57:33 PM
Registered User
Joined: 12/19/2004
Posts: 10
Try this:    AVGC20>AVGC20.5
bustermu
Posted : Sunday, January 13, 2008 5:37:41 AM
Registered User
Joined: 1/1/2005
Posts: 2,645
Joe,

A PCF for the SMA20 to increase for the current bar when on a weekly (5-day) timeframe is:

C > C100

Thanks,
Jim Murphy
diceman
Posted : Sunday, January 13, 2008 6:38:32 AM
Registered User
Joined: 1/28/2005
Posts: 6,049
bustermu's PCF is for a "true" condition.
 
If one is interested in finding the cross:
 
 
C>C100ANDC1<C101
 
 
Thanks
diceman
 
 
bustermu
Posted : Sunday, January 13, 2008 7:33:22 AM
Registered User
Joined: 1/1/2005
Posts: 2,645

QUOTE (diceman)
If one is interested in finding the cross:

C>C100ANDC1<C101


diceman,

I do not know what you mean by "cross"?

The PCF relates to an SMA20 on a 5-day timeframe as follows:

The PCF returns True if and only if the MA increased for the current bar and decreased for the previous bar.

Thanks,
Jim Murphy

 

diceman
Posted : Sunday, January 13, 2008 11:29:04 AM
Registered User
Joined: 1/28/2005
Posts: 6,049
bustermu
 
I haven't checked it but I assume your PCF would be true
when:
 
(C+C5+C10....C95/20)>(C5+C10+C15...C100/20)
 
(or at least very close)
 
I view this weeks 20 period SMA moving from below to above
last weeks 20 period SMA as the cross.
 
Essentially looking for the first day your PCF was true.
 
Much like a dual moving average cross. I would guess
the beginning of the run may be of interest to some
traders.
------------------------------------------------------------------------
 
My PCF is not perfect as:
 
C>C100ANDC1<C101 will not catch your PCF's first
true day if C1=C101.
 
(but its most likely sufficient)
------------------------------------------------------------------------
Obviously since we don't have true "calendar weeks"
some of this is open to interpretation.
 
 
I would also consider:
 
 
AVGC100>AVGC100.5
 
 
an "equivalent" to your PCF.
 
 
Possibly it may be superior as more smoothing
is involved. It would all depend on what one is
looking for.
 
 
 
Thanks
diceman
 
 
bustermu
Posted : Sunday, January 13, 2008 4:08:34 PM
Registered User
Joined: 1/1/2005
Posts: 2,645
diceman,

Thanks for your response.

QUOTE (diceman)
I haven't checked it but I assume your PCF would be true when:
 
(C+C5+C10....C95/20)>(C5+C10+C15...C100/20)

(or at least very close)


I suppose the above PCF was intended to be:

(C+C5+C10+...+C95)/20 > (C5+C10+C15+...+C100)/20

Otherwise, it is not much related to an SMA20 on a 5-day chart.  If we cancel like terms on each side of the inequality it reduces to:

C > C100

which is the PCF I supplied.

QUOTE (diceman)
I view this weeks 20 period SMA moving from below to above last weeks 20 period SMA as the cross.


This is, to me, a new definition of "cross".

QUOTE (diceman)
Obviously since we don't have true "calendar weeks" ...


As you and I know TeleChart does not have "weekly" charts.  It does, however, have five different 5-day charts.

The remainder of your post is interesting, but does not pertain directly to the original request.

I previously described your PCF:

C>C100 AND C1<C101
 
incorrectly.  The second term, C1 < C101 has nothing to do with the current 5-day chart.  You likely intended:

C>C100 AND C5<C105

That is what I described.
 
Thanks,
Jim Murphy 
diceman
Posted : Sunday, January 13, 2008 8:27:37 PM
Registered User
Joined: 1/28/2005
Posts: 6,049
bustermu
 
Since we are basically examining 2 price
variables and asking for one to be above the
other:
 
 (C+C5+C10+...+C95)/20
 
and
 
(C5+C10+C15+...+C100)/20
 
Why would the concept of a "cross" seem odd?
--------------------------------------------------------------------
 
"You likely intended:

C>C100 AND C5<C105"
--------------------------------------------------------
 
I view your PCF as able to change from false to true on any day
its observed. So my intent was to look at C1 in order  to catch
the first day its true.
 
Of course:
 
 C>C100 AND C5<C105
 
is acceptable as long as one understands the ramifications.
 
 
Thank
diceman
 
 
joemar1961
Posted : Monday, January 14, 2008 9:10:42 PM
Gold Customer Gold Customer

Joined: 7/26/2007
Posts: 26
Wow. Lotta stuff there.
To clarify and simplify, I want to do a scan once a week on the weekend.
I am looking at a weekly chart and I want to see the 20sma above the 20sma last week.

Thanks,
Joe
diceman
Posted : Monday, January 14, 2008 10:39:24 PM
Registered User
Joined: 1/28/2005
Posts: 6,049
bustermu's scan should be sufficient:
 
 
 C > C100
 
 
Realize that some of the complications come from the
fact that weekly charts in TC use 5 days of data.
(not calander weeks)
 
So a "weekly" indicator can go true on any day
depending on what it is and how its looked at.
(also things like holidays)
 
 
Thanks
diceman
joemar1961
Posted : Monday, January 14, 2008 11:50:43 PM
Gold Customer Gold Customer

Joined: 7/26/2007
Posts: 26

Sounds good.
Thank you all,
Joe

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.