Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

pcf for a range breakout Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
codegakiwi
Posted : Monday, May 21, 2012 2:18:54 PM
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.

Bruce_L
Posted : Monday, May 21, 2012 2:27:15 PM


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
codegakiwi
Posted : Monday, May 21, 2012 3:51:11 PM
Registered User
Joined: 3/31/2011
Posts: 33

Great. Thanks.

Bruce_L
Posted : Monday, May 21, 2012 3:56:51 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

You're welcome.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.