Gold Customer
Joined: 6/13/2009 Posts: 5
|
I am looking for a way to determine the minimum (or maximum) of a simple moving average, e.g. SMA20 of closing price. To be certain for this to be a minimum, I would have to wait long enough for the MA to turn up again for a few days.
If this was a function (e.g. a parabola), it would be a few "days" after the lowest point with a slope of zero.
One difficulty in creating such a PCF seems that a minimum can occur e.g. within a 2 week time frame or it can last much longer.
Thanks for your help.
Siggi
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You could explicitly test for the Moving Average to be decreasing or flat for a few bars and then increasing for a few bars. If we use three bars as our definition of "a few bars", we would get the following Condition Formula:
AVGC20 > AVGC20.1 AND AVGC20.1 > AVGC20.2 AND AVGC20.2 > AVGC20.3 AND AVGC20.3 <= AVGC20.4 AND AVGC20.4 <= AVGC20.5 AND AVGC20.5 <= AVGC20.6
PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!
-Bruce Personal Criteria Formulas TC2000 Support Articles
|