Registered User Joined: 3/31/2011 Posts: 33
|
Attempting to write a pcf that would test a range of time for variance and compare it to the current day. So let's say I want to find where the previous 20 trading days (not including today) did not exceed a range of 5%. So no day in that period exceeded 5% from the average price for that range. I don't want to include the current day because I want to check for a greater than 5% range on that day.
Appreciate the help.
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Normally I would just check for the Maximum High to be within 5% of the Minimum Low over the period:
MAXH20.1 <= 1.05 * MINL20.1
This would make sure that all prices were within 5% of each other. You have specified that no day be more than 5% from the average price for that range. This might be more like:
.95 * AVGC20.1 <= MINL20.1 AND MAXH20.1 <= 1.05 * AVGC20.1
Note that these formulas just check for the average range over the prior 20-bars. They do not check for a breakout during the current bar.
PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 3/31/2011 Posts: 33
|
Great. Thanks.
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|