Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 6/18/2010 Posts: 29
|
I want to screen for ADX so it shows those stocks the have the following:
Ex:
ADX 16.4, then next ADX 15.1, then next ADX 15.8, then next one 17.
The second ADX is lower than the first, the third ADX is higher than the second reading and the fourth ADX is higher than the third.
Thanks
|
|
Administration
Joined: 9/30/2004 Posts: 9,187
|
You can do this in version 17 with the following formula in a Custom PCF% True plot or by adding it as a column:
ADX(16,4) > ADX(15,1) AND ADX(15,8) > ADX(15,1) AND ADX(17,1) > ADX(15,8)
|
|
Registered User Joined: 6/18/2010 Posts: 29
|
Thanks for the reply but the numbers were only for an example. Do you know what the PCF would be for when:
the second ADX is lower than the first, the third ADX is higher than the second reading and the fourth ADX is higher than the third.
Thanks
|
|
Administration
Joined: 9/30/2004 Posts: 9,187
|
ADX(1,1) > ADX(2,1) AND ADX(3,1) > ADX(2,1) AND ADX(4,1) > ADX(3,1)
|
|
Registered User Joined: 6/18/2010 Posts: 29
|
This doesn't work. I scanned the s/p 500 stocks on 3/27/17. HD is the first listed. The 14 period ADX(14) is as follows:
ADX1 = 54.46
ADX2 = 52.98
ADX3 = 52.52
ADX4 = 51.24
So in this example from the scan conditions, ADX1 is greater than ADX2 which is correct according to the scan. But ADX3 is not greater than ADX2 and ADX4 is not greater than ADX3.
Can we correct the code? Thanks for your help.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
ADX has three parameter is the Personal Criteria Fomula Language.
Average Directional Index ADX and ADXR
The first parameter is the DI period.
The second parameter is the smoothing period.
The third parameter is the bars ago parameter.
In most cases the first and second parameters will be set to match. So in the case of a 14 period ADX, both the DI period and smooth period would be set to 14.
So:
ADX14.14 > ADX14.14.1 AND ADX14.14.1 > ADX14.14.2 AND ADX14.14.2 > ADX14.14.3 AND ADX14.14.3 > ADX14.14.4
Would check for the current 14 period ADX being greater than 1 bar ago, 1 bar ago greater than 2 bars ago, 2 bars ago greater than 3 bars ago and 3 bars ago greater than 4 bars ago.
This could also be written as follows.
TrueInRow(ADX14.14 > ADX14.14.1, 4) = 4
If you want, "The second ADX is lower than the first, the third ADX is higher than the second reading and the fourth ADX is higher than the third.", and the first is furthest to the left, then you would want something like the following.
ADX14.14.2 < ADX14.14.3 AND ADX14.14.1 > ADX14.14.2 AND ADX14.14 > ADX14.14.1
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 6/18/2010 Posts: 29
|
That worked Bruce. Thank you so much
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |