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 |

Price with in 1% of 20EMA Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
maher_79
Posted : Tuesday, August 23, 2011 3:41:29 PM
Registered User
Joined: 8/16/2009
Posts: 42
I'm working on an ADX scan and one of the crietera I need is the price to be within 1% of the 20 EMA.  So the price could be stilgtly above, sligtly below, or right on the 20 EMA.  So, the % value could be adjusted depending on how close I want the price to be to the 20 EMA.

Hope i explained it well.  thanks!
Bruce_L
Posted : Tuesday, August 23, 2011 3:46:15 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
You could write a Condition Formula for Price being within 1% of the 20-Period Exponential Moving Average as:

100 * ABS(C / XAVGC20 - 1) <= 1

You can adjust the percentage by adjusting the <= 1 to something else.

PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
maher_79
Posted : Thursday, August 25, 2011 6:35:18 PM
Registered User
Joined: 8/16/2009
Posts: 42
Thanks Bruce, the formula was missing a ")"

100 * (ABS(C / XAVGC20) - 1) <= 1
maher_79
Posted : Thursday, November 3, 2011 8:48:08 PM
Registered User
Joined: 8/16/2009
Posts: 42
Bruce, are you sure this works - i keep getting stocks way away from the 20 EMA.  Can you test that one your end? i'm using TC2000.

Thanks!
Bruce_L
Posted : Friday, November 4, 2011 8:52:54 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Yes, I'm sure it works.

C / XAVGC20 would produce 1.01 if Price was 1% above the Moving Average. You would get .01 if you subtracted 1 from this.

C / XAVGC20 would produce .99 if Price was 1% below the Moving Average. You would get -.01 if you subtracted 1 from this.

Anything that is between 1% above and 1% below the Moving Average would have to be between .01 and -.01 as a result. If we take the absolute value of the result, this would mean it would have to be at or below .01 to be within 1% of the Moving Average.

We have multiplied the absolute value by 100 to convert it into a percentage. This means when need to set it to be <= 1 to check for price to be between 1% above and 1% below the Moving Average inclusive.

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