Registered User Joined: 8/30/2011 Posts: 161
|
id like to make a scan that will look for stocks trading within a percentage range of their MA
i.e. Price is 3 % above 30 daily ma
Price is 3 % above weekly MA
Price is below XX MA daily or weekly
thanks
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Price is within 3% of a 30-period simple moving average could be written as:
ABS(C / AVGC30 - 1) <= .03
If you want price to be above the moving average but within 3%:
AVGC30 < C AND C <= 1.03 * AVGC30
If you want price to be below the moving average but within 3%:
.97 * AVGC30 <= C AND C < AVGC30
If you want price to be at least 3% above the moving average:
1.03 * AVGC30 <= C
If you want price to be at least 3% below the moving average:
C <= .97 * AVGC30
If you want price to be at least 3% away from the moving average:
C <= .97 * AVGC30 OR 1.03 * AVGC30 <= C
You can AND daily and weekly versions of the formulas by adding the formula to an EasyScan twice and setting a different time frame for each EasyScan Condition, but there is not a way to OR different time frames in TC2000 version 12.3.
PCF Formula Descriptions
Building a Scan with Multiple Conditions
Handy PCF example formulas to help you learn the syntax of PCFs!
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 8/30/2011 Posts: 161
|
thanks again
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|