Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
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.
|
|
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!
|
|
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
|
|
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!
|
|
Guest-1 |