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 |

Average True Range PCF Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
davidc1
Posted : Tuesday, July 16, 2013 6:43:53 AM
Registered User
Joined: 3/31/2011
Posts: 90

I would like to create a condition that ATR1 is 2x greater than the SMA 25 of ATR1 today. I've tried from the chart but it only gives the option of being above/below the MA, not by a certain factor.

Could you put something together please?

Bruce_L
Posted : Tuesday, July 16, 2013 7:45:32 AM


Worden Trainer

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

Please try the following Condition Formula:

(H - L + ABS(H - C1) + ABS(C1 - L)) / 2 > 2 * ((AVGH25 - AVGL25) / 2 + (ABS(H - C1) + ABS(C1 - L) + ABS(H1 - C2) + ABS(C2 - L1) + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H3 - C4) + ABS(C4 - L3) + ABS(H4 - C5) + ABS(C5 - L4) + ABS(H5 - C6) + ABS(C6 - L5) + ABS(H6 - C7) + ABS(C7 - L6) + ABS(H7 - C8) + ABS(C8 - L7) + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H9 - C10) + ABS(C10 - L9) + ABS(H10 - C11) + ABS(C11 - L10) + ABS(H11 - C12) + ABS(C12 - L11) + ABS(H12 - C13) + ABS(C13 - L12) + ABS(H13 - C14) + ABS(C14 - L13) + ABS(H14 - C15) + ABS(C15 - L14) + ABS(H15 - C16) + ABS(C16 - L15) + ABS(H16 - C17) + ABS(C17 - L16) + ABS(H17 - C18) + ABS(C18 - L17) + ABS(H18 - C19) + ABS(C19 - L18) + ABS(H19 - C20) + ABS(C20 - L19) + ABS(H20 - C21) + ABS(C21 - L20) + ABS(H21 - C22) + ABS(C22 - L21) + ABS(H22 - C23) + ABS(C23 - L22) + ABS(H23 - C24) + ABS(C24 - L23) + ABS(H24 - C25) + ABS(C25 - L24)) / 50)

Please provide a description and PCF for calculating an ATR value to be used as a stop loss value



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
davidc1
Posted : Tuesday, July 16, 2013 10:07:13 AM
Registered User
Joined: 3/31/2011
Posts: 90

Yes that's great thank you.

steppingstoneent
Posted : Friday, July 19, 2013 6:38:33 AM
Registered User
Joined: 11/7/2009
Posts: 14

I would like to create a similar/related VALUE column that shows what % of price the 30 day ATR is. 

For example, if a stock costs $100, and the 30 day ATR is 2.50 - the column would show 2.5%.  Ideally I could then (obviously) sort the column of a watchlist AND/OR scan for the condition when the 30 day ATR VALUE is greater than or less than x% of price.

Thanks to another discussion board, I already have the formula for this second piece (the scanning of the condition  - see below):

(100*((AVGH15 - AVGL15) / 2 + (ABS(H - C1) + ABS(C1 - L) + ABS(H1 - C2) + ABS(C2 - L1) + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H3 - C4) + ABS(C4 - L3) + ABS(H4 - C5) + ABS(C5 - L4) + ABS(H5 - C6) + ABS(C6 - L5) + ABS(H6 - C7) + ABS(C7 - L6) + ABS(H7 - C8) + ABS(C8 - L7) + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H9 - C10) + ABS(C10 - L9) + ABS(H10 - C11) + ABS(C11 - L10) + ABS(H11 - C12) + ABS(C12 - L11) + ABS(H12 - C13) + ABS(C13 - L12) + ABS(H13 - C14) + ABS(C14 - L13) + ABS(H14 - C15) + ABS(C15 - L14)) / 30)/C) > 4.0

This above formula is set to scan for when the ATR is greater than 4% of price, and it works just fine.  However, again, I would like to get a column specifically dedicated to showing the 30 day ATR's % of price as a VALUE.

I hope that makes sense and thanks in advance!

 

Bruce_L
Posted : Friday, July 19, 2013 7:33:37 AM


Worden Trainer

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

Your Condition Formula uses a 15-Period ATR instead of using a 30-Period ATR. An Indicator Formula for the 30-Period ATR expressed as a percent of the current price could be written as:

100 * ((AVGH30 - AVGL30) / 2 + (ABS(H - C1) + ABS(C1 - L) + ABS(H1 - C2) + ABS(C2 - L1) + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H3 - C4) + ABS(C4 - L3) + ABS(H4 - C5) + ABS(C5 - L4) + ABS(H5 - C6) + ABS(C6 - L5) + ABS(H6 - C7) + ABS(C7 - L6) + ABS(H7 - C8) + ABS(C8 - L7) + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H9 - C10) + ABS(C10 - L9) + ABS(H10 - C11) + ABS(C11 - L10) + ABS(H11 - C12) + ABS(C12 - L11) + ABS(H12 - C13) + ABS(C13 - L12) + ABS(H13 - C14) + ABS(C14 - L13) + ABS(H14 - C15) + ABS(C15 - L14) + ABS(H15 - C16) + ABS(C16 - L15) + ABS(H16 - C17) + ABS(C17 - L16) + ABS(H17 - C18) + ABS(C18 - L17) + ABS(H18 - C19) + ABS(C19 - L18) + ABS(H19 - C20) + ABS(C20 - L19) + ABS(H20 - C21) + ABS(C21 - L20) + ABS(H21 - C22) + ABS(C22 - L21) + ABS(H22 - C23) + ABS(C23 - L22) + ABS(H23 - C24) + ABS(C24 - L23) + ABS(H24 - C25) + ABS(C25 - L24) + ABS(H25 - C26) + ABS(C26 - L25) + ABS(H26 - C27) + ABS(C27 - L26) + ABS(H27 - C28) + ABS(C28 - L27) + ABS(H28 - C29) + ABS(C29 - L28) + ABS(H29 - C30) + ABS(C30 - L29)) / 60) / C



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
steppingstoneent
Posted : Friday, July 19, 2013 2:46:03 PM
Registered User
Joined: 11/7/2009
Posts: 14

First, you're damn fast.

Second, you're pretty dope at this. (That's a good thing.)

Third, I'm giddy!

THANK YOU!

stanleyikem
Posted : Friday, January 4, 2019 1:52:29 PM
Registered User
Joined: 2/9/2011
Posts: 76

Hi Bruce,

How do I write a condition PCF that;

 

1.  caclulates the ATR is great than a number for instance; ATR > 1

2. I can use to find stocks where he ATR is currently X% (maybe 10%), more than the average true range over a X period (maybe 14 days) 

 

Thanks 

Bruce_L
Posted : Friday, January 4, 2019 1:59:25 PM


Worden Trainer

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

You are using TC2000 v18, so the formulas are going to be a lot shorter than what is given above.

So with a 14-period ATR, you can just write:

ATR14

So checking for this being greater than 1 would be:

ATR14 > 1

Checking for the current true range at least 10% greater than the current 14 period ATR could be written as:

ATR > 0 AND 10 * ATR > 11 * ATR14

But you would usually want to compare this to the ATR from the previous bar instead.

ATR > 0 AND 10 * ATR > 11 * ATR14.1



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
stanleyikem
Posted : Friday, January 4, 2019 2:19:13 PM
Registered User
Joined: 2/9/2011
Posts: 76

Thanks a lot Bruce. Is there a way to calculate however what the ATR of a basket of stocks is... Say I have a basket of 100 stocks and I want to check what the general average ATR of all the ATR's on this list is? Anyway to do that?

 

Bruce_L
Posted : Friday, January 4, 2019 2:23:49 PM


Worden Trainer

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

No, there really isn't any sort of way to do that in TC2000.



-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.