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 |

pcf's Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
idlipman
Posted : Thursday, June 16, 2005 6:52:07 PM
Registered User
Joined: 12/28/2004
Posts: 15
is there a formula for absolute value? I want to take the absolute value of (xavg20.25-xavg50.25)

i also want to get the max of the above formula for 20 days.
i.e. the max of (xavg20.25-xavg50.25)and (xavg20.26-xavg50.26) and (xavg20.27-xavg50.27)etc.
Doug_H
Posted : Thursday, June 16, 2005 7:46:16 PM


Worden Trainer

Joined: 10/1/2004
Posts: 4,308
You can put ABS before your first formula to get the absolute value.

I know of no way to find the MAX of the formulas you have listed. Perhaps someone can think of a way, but I'm not sure it's possible.

- Doug
Teaching Online!
bustermu
Posted : Friday, June 17, 2005 5:38:47 AM
Registered User
Joined: 1/1/2005
Posts: 2,645
QUOTE (Doug_H)

I know of no way to find the MAX of the formulas you have listed. Perhaps someone can think of a way, but I'm not sure it's possible.


If you can find the maximun of two values, you can find the maximum of any finite number of values (unless you exceed the number of characters permitted in a PCF). But, that is not the reason for this post.

I have seen you make statements similar to:

"...I'm not sure it's possible."

a number of times. This has lead me to believe you may be aware of something "usefull" that could be computed on a Symbol's data sequence that can not be accomplished with the present PCF Language but could be accomplished with an addition to the Language. If so, can you please supply us with an example?

Thanks,
Jim Murphy
Craig_S
Posted : Friday, June 17, 2005 7:07:39 AM


Worden Trainer

Joined: 10/1/2004
Posts: 18,819
Doug said "...I'm not sure it's possible." because he was not sure it was possible. He emailed Bruce and I after posting this. No hidden info or secret knowledge.

QUOTE (idlipman)
is there a formula for absolute value? I want to take the absolute value of (xavg20.25-xavg50.25)

i also want to get the max of the above formula for 20 days.
i.e. the max of (xavg20.25-xavg50.25)and (xavg20.26-xavg50.26) and (xavg20.27-xavg50.27)etc


ABS(xavg20.25-xavg50.25)
This will return the absolute value of the difference of the two indicators.

With your second request you are essencially looking to find the stocks who's price has fallen/rose so much with the last 40 days or so to cause the averages to be the farthest from each other for the history of the chart.

Max and Min are possible using either ABS or Boolean expressions to make the comparisons, but 20 days would result in a rather long expansion, so it would be slow and probably not worth it. I would visually sort by the visual difference of the two averages OR by the visual value of the (MACD20,50). Sorting by the visual change in price over a 40-bar period would do the trick as well.

Here are some videos for you to look at:

Understanding Moving Averages - Part I, The Basics

Understanding Moving Averages - Part II, Using Multiple Averages

Understanding MACD

Sort by Visual Value to find new highs and lows in price and indicators

Sort by indicator or price movement using Visual Change sorts

Comparing indicators using Visual Difference sorts




- Craig
Here to Help!
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.