TC2000.com• Download software • Tutorial videos • Subscription & data-feed pricing • Class schedule
TC2000Brokerage.com• New account application • Trading resources • Margin rates • Stock & option commissions
Worden Discussion Forum
Customer Training & Support
Ask a Trainer - TC2000 version 12/18
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.
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!