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 |

moving averages Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
dmalyga
Posted : Thursday, October 9, 2014 12:11:45 PM
Gold Customer Gold Customer

Joined: 11/9/2009
Posts: 36

Hi Bruce,

 

Is it possible that I can create a scan where it will indicate when two moving averages are closing closer together (ie 20,50 ma) 

Another question what is the best way to indicate that through %  or rate of change?

 

Thanks,

Bruce_L
Posted : Thursday, October 9, 2014 12:21:02 PM


Worden Trainer

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

A Condition Formula checking for the distance between the 20 and 50 period simple moving averages being less during the current bar than during the previous bar can be written as follows.

ABS(AVGC20 - AVGC50) < ABS(AVGC20.1 - AVGC50.1)

Expressing the change in distance between the 20 and 50 period simple moving averages as a percent change could be done as follows.

100 * (ABS(AVGC20 - AVGC50) / ABS(AVGC20.1 - AVGC50.1) - 1)

Note that this a a percent change of the distance. If you want the difference in the percent difference, you would need to specific the basis for the percentage.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
dmalyga
Posted : Thursday, October 9, 2014 12:50:22 PM
Gold Customer Gold Customer

Joined: 11/9/2009
Posts: 36

how about 0.5%

Bruce_L
Posted : Thursday, October 9, 2014 12:54:01 PM


Worden Trainer

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

Sorry for the misunderstanding. When I said the difference in the percent difference would require a basis for the percentage, the basis is not a value being returned. The basis is what you want to use to calculate the percentage in the first place. Do you want to use price, the 20 period average, the 50 period average, the midpoint of the moving averages or something else?

If you want to check for the moving averages being within 0.5% of each other, you could use something similar to the following.

ABS(AVGC20 / AVGC50 - 1) <= .005 AND ABS(AVGC50 / AVGC20 - 1) <= .005



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
dmalyga
Posted : Thursday, October 9, 2014 1:06:10 PM
Gold Customer Gold Customer

Joined: 11/9/2009
Posts: 36

the midpoint between the two averages

Bruce_L
Posted : Thursday, October 9, 2014 1:09:31 PM


Worden Trainer

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

The difference in the percent difference using the mid point of the percantages as the basis of the percentage could be written as follows.

50 * (ABS(AVGC20 - AVGC50) - ABS(AVGC20.1 - AVGC50.1)) / (AVGC20 + AVGC50)



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