Registered User Joined: 5/8/2006 Posts: 6
|
I have looked and looked and cannot seem to find out how to write a pcf for when price is say within one or two percent of a 50 sma. This should not be tpoo hard to do? But I am severely challenged in writing pcf's based on indicators because I do not use indicators to trade with at all. BUT for scanning purposes I would like to see a list of stocks where the price is within a percentage of that 50sma if at all possible? Please help? Can a pcf be written that would reference the same condition on both the weekly and daily charts to show when that condition is present on both time frames at the same time for scanning purposes? Thanks in advance!
|
Registered User Joined: 9/17/2010 Posts: 484
|
Close to 50 D MA: 100*Abs(C-AvgC50)/C<2
Adjust the last value (2 here) for the degree of closeness you want
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The formula provided by bcochrane will return true when the 50 period simple moving average of price is within 2% of price.
If you need to use the 50 period simple moving average as the basis of the percentage, you could use something like the following instead (which checks for price to be within 1% of the SMA50).
ABS(C / AVGC50 - 1) <= .01
In this case it would be the .01 which would get adjusted to adjust the percentage.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|