Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 11/19/2015 Posts: 459
|
Hello. Hope you had an enjoyable weekend.
I'm working on a concept that I might break into a couple of small requests over time.
Is there a way to calculate the largest-magnitude price change over a given period in absolute terms and then divide that absolute change by a given period?
As an example, if the current bar's close is below the H five days ago, that will be a different (greater) price change than if calculated from the L five days ago. And vice versa -- if the current bar's close is above the H five days ago, that value will be less than the current close - L5. So, regardless of price direction, I'm looking to find the absolute value change and then divide it by the lookback period in bars.
So: absolute price change starting x bars back / x bars
I would call this "velocity".
Say the example is over 3 days...
Thank you very much.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I am not quite sure if you are interested in the following (most likely based ony our example).
GREATEST(ABS(C - L3), ABS(C - H3)) / 3
Or the following (possible, but less in line with your example).
GREATEST(ABS(C - MINL4), ABS(C - MAXH4)) / 3
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 11/19/2015 Posts: 459
|
Thank you, Bruce. These are neat and provide me with examples of how to construct the idea. Perfect.
I realize after looking at BRKA (or any expensive security) that it could be helpful to express these in percent terms or some other comparitive output. Is there a suggestion on something along these lines?
Thank you very much.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
A percent version of the first one would be the following.
100 * GREATEST(ABS((C / L3) ^ (1 / 3) - 1), ABS((C / H3) ^ (1 / 3) - 1))
And a percent version of the second one would be the following.
100 * GREATEST(ABS((C / MINL4) ^ (1 / 3) - 1), ABS((C / MAXH4) ^ (1 / 3) - 1))
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 11/19/2015 Posts: 459
|
Perfect. Thank you very much for putting these together. Much appreciated.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |