Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
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,
|
|
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
|
|
Gold Customer
Joined: 11/9/2009 Posts: 36
|
how about 0.5%
|
|
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
|
|
Gold Customer
Joined: 11/9/2009 Posts: 36
|
the midpoint between the two averages
|
|
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
|
|
Guest-1 |