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 |

Scanning for Multiple Narrow Range Bars Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Hafeez31
Posted : Thursday, August 20, 2009 7:45:36 AM
Registered User
Joined: 5/9/2009
Posts: 31
Hello Trainers,
I want to scan for stocks where price has been in in uptrend and now bar range has been reduced for X number of previous bars. I have done a regression sort to find the uptrending scan. I want to know how to make a PCF to scan for NRB during last X number of days,.

Thanks in advance

Bruce_L
Posted : Thursday, August 20, 2009 9:19:49 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
If you want to find out if the current Range is less than previous Range, you could use:

H - L < H1 - L1

If you want to find out if the current Range is less than the Ranges of the previous two Bars, you could use:

H - L < H1 - L1 AND H - L < H2 - L2

Adding additional days merely requires adding more AND H - L < Hx - Lx bits to the end:

NR3:

H - L < H1 - L1 AND H - L < H2 - L2 AND H - L < H3 - L3

NR4:

H - L < H1 - L1 AND H - L < H2 - L2 AND H - L < H3 - L3 AND H - L < H4 - L4

NR5:

H - L < H1 - L1 AND H - L < H2 - L2 AND H - L < H3 - L3 AND H - L < H4 - L4 AND H - L < H5 - L5

You may wish to review the following:

How to create a Personal Criteria Forumula (PCF)
PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Hafeez31
Posted : Thursday, August 20, 2009 9:36:48 AM
Registered User
Joined: 5/9/2009
Posts: 31
Thanks for your prompt reply Bruce.
Much Appreciated.
Hafeez31
Posted : Thursday, August 20, 2009 9:38:59 AM
Registered User
Joined: 5/9/2009
Posts: 31

What if i have to look for narrowing range i.e. not necessarily narrowest range in the last x bars. Can i use <= operator

Bruce_L
Posted : Thursday, August 20, 2009 10:13:19 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Yes you can use less than or equal to instead of less than if you want. You can also check for narrowing bars instead of just checking for the last bar being the narrowest by incrementing the first part of the comparison instead of just the second. If you want to find out if the current Range is less than or equal to the previous Range, you could use:

H - L <= H1 - L1

If you want to find out if the current Range is less than or equal to the previous Range while that Range is also less than or equal to the Range of the bar before that, you could use:

H - L <= H1 - L1 AND H1 - L1 <= H2 - L2

Adding additional days merely requires adding more AND H(x-1) - L(x-1) <= Hx - Lx bits to the end:

NR3:

H - L <= H1 - L1 AND H1 - L2 <= H2 - L2 AND H2 - L3 <= H3 - L3

NR4:

H - L <= H1 - L1 AND H1 - L2 <= H2 - L2 AND H2 - L3 <= H3 - L3 AND H3 - L4 <= H4 - L4

NR5:

H - L <= H1 - L1 AND H1 - L1 <= H2 - L2 AND H2 - L2 <= H3 - L3 AND H3 - L3 <= H4 - L4 AND H4 - L4 <= H5 - L5

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Hafeez31
Posted : Thursday, August 20, 2009 10:20:34 AM
Registered User
Joined: 5/9/2009
Posts: 31
Thanks. I'll try that.
Bruce_L
Posted : Thursday, August 20, 2009 10:57:18 AM


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.