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

PCF for shorter ROC's greaer than longer ROC's Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Kirkj21
Posted : Sunday, January 14, 2007 12:43:38 PM
Registered User
Joined: 8/19/2006
Posts: 11
Is there a way to write a PCF for 5 day ROC > than 10 day ROC > 20 day ROC > 50 Day Roc?

Thank You
bustermu
Posted : Sunday, January 14, 2007 3:32:39 PM
Registered User
Joined: 1/1/2005
Posts: 2,645
QUOTE (Kirkj21)
Is there a way to write a PCF for 5 day ROC > than 10 day ROC > 20 day ROC > 50 Day Roc?


Kirkj21,

You did not say what the ROC is applied to. If it was applied to C, the requested PCF is:

C5<C10 AND C10<C20 AND C20<C50

The reason I responded to your request is that that if you were yet familiar enough with the PCF Language to construct the four ROCs on the same scale in order to observe the condition, you would now be more than familiar enough with the Language to write the PCF. Thus, I doubt your request was really what you wanted.

Notice that what you have asked for is a PCF that detects a downtrend beginning at least 50 days ago and lasting at least until 5 days ago. One knows whether or not this is going to happen 5 days ago. Why would you want to wait until today to detect its occurance?

Thanks,
Jim Murphy
diceman
Posted : Sunday, January 14, 2007 6:53:22 PM
Registered User
Joined: 1/28/2005
Posts: 6,049
I think this should be:

C5>C10 AND C10>C20 AND C20>C50

an uptrend was requested.


But this is not the same as:

((C-C5)>(C-C10))AND((C-C10)>(C-C20))AND((C-C20)>(C-C50))

If Im understanding the question.

or maybe:

((C-C5)>(C-C10))AND((C-C5)>(C-C20))AND((C-C5)>(C-C50))

Not clear what was asked for.


Thanks
diceman
Kirkj21
Posted : Sunday, January 14, 2007 9:20:34 PM
Registered User
Joined: 8/19/2006
Posts: 11
QUOTE (bustermu)
QUOTE (Kirkj21)
Is there a way to write a PCF for 5 day ROC &gt; than 10 day ROC &gt; 20 day ROC &gt; 50 Day Roc?


Kirkj21,

You did not say what the ROC is applied to. If it was applied to C, the requested PCF is:

C5&lt;C10 AND C10&lt;C20 AND C20&lt;C50

The reason I responded to your request is that that if you were yet familiar enough with the PCF Language to construct the four ROCs on the same scale in order to observe the condition, you would now be more than familiar enough with the Language to write the PCF. Thus, I doubt your request was really what you wanted.

Notice that what you have asked for is a PCF that detects a downtrend beginning at least 50 days ago and lasting at least until 5 days ago. One knows whether or not this is going to happen 5 days ago. Why would you want to wait until today to detect its occurance?

Thanks,
Jim Murphy


The reason I asked is because I am trying different ways to construct different models/variations to display uptrends. I have constructed one where the shorter MA's were above the longer MA's (AKA Fan Pattern) so I am trying to develop a Model where the shorter ROC's are rising quicker than the longer one's.
bustermu
Posted : Sunday, January 14, 2007 10:17:28 PM
Registered User
Joined: 1/1/2005
Posts: 2,645
QUOTE (diceman)
Not clear what was asked for.


diceman,

What was asked for was:

"Is there a way to write a PCF for 5 day ROC > than 10 day ROC > 20 day ROC > 50 Day Roc?"

which is equivalent to:

C5<C10 AND C10<C20 AND C20<C50

which constitutes a downtrend up until 5 days ago. The request imposes no constraints whatever on what has happened in the most recent 5 days.

From Kirkj21's response after your post, we know that the request was not what was desired in the first place. This was just as I suspected and was the only reason I made my first post.

Thanks,
Jim Murphy
diceman
Posted : Monday, January 15, 2007 12:29:48 AM
Registered User
Joined: 1/28/2005
Posts: 6,049
You lost me bustermu.

My thinking is a 5 day ROC is:

(C-C5)=A

10 day ROC is:

(C-C10)=B

We must ask if A is > B to determine if a 5 day
ROC is > than a 10 day ROC.

Also if C=13, C5=10, C10=11


We have a 5 day ROC=3, 10 day ROC=2.

So we have a 5ROC>10ROC with an uptrend.

Thanks
diceman
Kirkj21
Posted : Monday, January 15, 2007 2:08:20 AM
Registered User
Joined: 8/19/2006
Posts: 11
I guess the best way I can explain it is with this example

I have this plotted in my middle window

ROC 5= RED Line
Roc 10=White
ROC 20=Yellow
ROC 30=BLue

I was hoping to come up with a way where the Red would be above the White which would be above the Yellow and that would be above the blue. Meaning a security's 5 day Rate of change would be higher than it's 10 day rate of change etc......

A perfect example of what I am trying to accomplish would be Ticker DADE or PRU
bustermu
Posted : Monday, January 15, 2007 6:01:18 AM
Registered User
Joined: 1/1/2005
Posts: 2,645
QUOTE (diceman)
...if C=13, C5=10, C10=11, we have a 5 day ROC = 3, 10 day ROC = 2.

So we have a 5ROC > 10ROC with an uptrend.


diceman,

You have the cart before the horse.

_____________

...if C=1, C5=10, C10=11, we have a 5 day ROC = -9, 10 day ROC = -10.

So we have a 5ROC > 10ROC with an uptrend?

_____________

This looks more like a downtrend to me.

Consider the inequality:

a-b > a-c

Subtract a from both sides to obtain:

-b > -c

Multiply both sides by -1, which reverses the inequality, to obtain:

b < c

or, equivalently:

c > b

Please notice that:

ROC(C,5) > ROC(C,10) > ROC(C,20) > ROC(C,50)

if and only if:

C-C5 > C-C10 > C-C20 > C-C50

if and only if:

C50 > C20 > C10 > C5

which constitutes a downtrend from 50 days ago until 5 days ago. Notice that:

ROC(C,5) > ROC(C,10) > ROC(C,20) > ROC(C,50)

has nothing to do with the value of the closes since 5 days ago.

Hopefully, this clears up the problem.

Thanks,
Jim Murphy
bustermu
Posted : Monday, January 15, 2007 6:51:47 AM
Registered User
Joined: 1/1/2005
Posts: 2,645
QUOTE (Kirkj21)
I have this plotted in my middle window

ROC 5= RED Line
Roc 10=White
ROC 20=Yellow
ROC 30=BLue

I was hoping to come up with a way where the Red would be above the White which would be above the Yellow and that would be above the blue. Meaning a security's 5 day Rate of change would be higher than it's 10 day rate of change etc......

A perfect example of what I am trying to accomplish would be Ticker DADE or PRU


Kirkj21,

You also appear to have "the cart before the horse".

I assume by "ROC" you mean "PROC".

I was unable to duplicate your observations for the two Symbols on any Zoom setting.

You should know that the four PROCs are on different scales. Their observed order has nothing to do with their numerical order and can change with the Zoom setting.

Ordering the PROCs does not produce what you appear to be looking for anyway.

Thanks,
Jim Murphy
diceman
Posted : Monday, January 15, 2007 9:12:46 AM
Registered User
Joined: 1/28/2005
Posts: 6,049
bustermu

I think some of this has to do with ambiguous nature
of the question. That being said. I do not see why
this is incorrect:

C=13
C5=10
C10=11
C20=11.1
C50=11.2

ROC5=3
ROC10=2
ROC20=1.9
ROC50=1.8

ROC5>ROC10>ROC20>ROC50

This appears to be true and in an uptrend. Also
if C=10 (or lower) this is not true.

It is not clear to me what you mean by putting
the cart before the horse. Yes this is in a downtrend from
C50 to C5 but to determine the 5ROC we need C.

The above was my interpretation of the equation. Its not clear
what I am missing. (or if we are talking about the same thing
in different terms)


Also:

Quote:"...if C=1, C5=10, C10=11, we have a 5 day ROC = -9, 10 day ROC = -10.

So we have a 5ROC > 10ROC with an uptrend?"

In this example you are using "C". C does not matter because
other ROC's are negative. In my example they are positive
so C appears to matter.(C-C5 must be > 2)


Thanks
diceman
bustermu
Posted : Monday, January 15, 2007 10:05:15 AM
Registered User
Joined: 1/1/2005
Posts: 2,645
QUOTE (diceman)
I do not see why this is incorrect:

C=13
C5=10
C10=11
C20=11.1
C50=11.2

ROC5=3
ROC10=2
ROC20=1.9
ROC50=1.8

ROC5 > ROC10 > ROC20 > ROC50

This appears to be true and in an uptrend. Also if C=10 (or lower) this is not true.


diceman,

The last sentence above is false. That appears to be the root of your problem.

The satisfaction of the inequality:

ROC5 > ROC10 > ROC20 > ROC50

has nothing to do with todays closing price, C.

Maybe Bruce can explain that to you better than I.

Thanks,
Jim Murphy
diceman
Posted : Monday, January 15, 2007 6:00:40 PM
Registered User
Joined: 1/28/2005
Posts: 6,049
I got it bustermu.

The light bulb finally went off.

I don't know if I'm using the proper terminology
but C is irrelevant because it impacts all ROCs
equally. Therefore it cannot create a change
in the relationships of the ROC's.

I typically do not like C-C5 for ROC because
it does not adjust for price. Any ROC I use is
in percent change form . I have not looked but I
would guess this creates a different set of rules.

Thanks
diceman
bustermu
Posted : Tuesday, January 16, 2007 8:03:04 AM
Registered User
Joined: 1/1/2005
Posts: 2,645
QUOTE (diceman)
I typically do not like C-C5 for ROC because it does not adjust for price. Any ROC I use is in percent change form . I have not looked but I would guess this creates a different set of rules.


diceman,

It does not make any difference whether you use ROC in the difference form or the percent change form, the end result is the same, i.e.:

C50>C20 AND C20>C10 AND C10>C5

It appears to me that what Kirkj21 actually wants is:

PROC5/5 > PROC10/10 > PROC20/20 > PROC50/50

The quantities are the averages of the daily changes over the days involved. The PCF is:

(C-C5)/5>(C-C10)/10 AND (C-C10)/10>(C-C20)/20 AND (C-C20)/20>(C-C50)/50

Thanks,
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.