Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 4/1/2011 Posts: 90
|
Hello Bruce,
Can you create a PCF that will count how many times a stock has closed within 5% of its range within the past 21 days.
Thanks in advance.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I'm not quite sure what you are asking, but if you want to count how many times in the previous 21 days that price closed at or below 5% of the range above the high of the current bar but at or above 5% of the range below the low of the current bar, it could be written as:
ABS(1.05 * L - .05 * H <= C1 AND C1 <= 1.05 * H - .05 * L) - (1.05 * L - .05 * H <= C2 AND C2 <= 1.05 * H - .05 * L) - (1.05 * L - .05 * H <= C3 AND C3 <= 1.05 * H - .05 * L) - (1.05 * L - .05 * H <= C4 AND C4 <= 1.05 * H - .05 * L) - (1.05 * L - .05 * H <= C5 AND C5 <= 1.05 * H - .05 * L) - (1.05 * L - .05 * H <= C6 AND C6 <= 1.05 * H - .05 * L) - (1.05 * L - .05 * H <= C7 AND C7 <= 1.05 * H - .05 * L) - (1.05 * L - .05 * H <= C8 AND C8 <= 1.05 * H - .05 * L) - (1.05 * L - .05 * H <= C9 AND C9 <= 1.05 * H - .05 * L) - (1.05 * L - .05 * H <= C10 AND C10 <= 1.05 * H - .05 * L) - (1.05 * L - .05 * H <= C11 AND C11 <= 1.05 * H - .05 * L) - (1.05 * L - .05 * H <= C12 AND C12 <= 1.05 * H - .05 * L) - (1.05 * L - .05 * H <= C13 AND C13 <= 1.05 * H - .05 * L) - (1.05 * L - .05 * H <= C14 AND C14 <= 1.05 * H - .05 * L) - (1.05 * L - .05 * H <= C15 AND C15 <= 1.05 * H - .05 * L) - (1.05 * L - .05 * H <= C16 AND C16 <= 1.05 * H - .05 * L) - (1.05 * L - .05 * H <= C17 AND C17 <= 1.05 * H - .05 * L) - (1.05 * L - .05 * H <= C18 AND C18 <= 1.05 * H - .05 * L) - (1.05 * L - .05 * H <= C19 AND C19 <= 1.05 * H - .05 * L) - (1.05 * L - .05 * H <= C20 AND C20 <= 1.05 * H - .05 * L) - (1.05 * L - .05 * H <= C21 AND C21 <= 1.05 * H - .05 * L)
PCF Formula Descriptions
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 4/1/2011 Posts: 90
|
Hey Bruce,
I don't think this is exactly what I was looking for. What i'm asking is...
Within the past 21 days how many time has a stock closed at or within 5% of its high for the day.
wouldn't you use STOC1 >= 95 for this?
Thanks in advance.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Thank you for the clarification, I did not see the high mentioned in your original post and was unsure what you were requesting. You are correct that the easiest way to do this would being using a stochastic.
ABS(STOC1 >= 95) - (STOC1.1.1 >= 95) - (STOC1.1.2 >= 95) - (STOC1.1.3 >= 95) - (STOC1.1.4 >= 95) - (STOC1.1.5 >= 95) - (STOC1.1.6 >= 95) - (STOC1.1.7 >= 95) - (STOC1.1.8 >= 95) - (STOC1.1.9 >= 95) - (STOC1.1.10 >= 95) - (STOC1.1.11 >= 95) - (STOC1.1.12 >= 95) - (STOC1.1.13 >= 95) - (STOC1.1.14 >= 95) - (STOC1.1.15 >= 95) - (STOC1.1.16 >= 95) - (STOC1.1.17 >= 95) - (STOC1.1.18 >= 95) - (STOC1.1.19 >= 95) - (STOC1.1.20 >= 95)
Understanding Stochastics
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 10/7/2004 Posts: 794
|
I just want to confirm that the PCF for close is not more then 20% below 52 weekly high
C>MaxH240 *.80
Thank you
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Less than 20% below 52 weekly high (so above the line that is 20% below the high) would probably be a few more days than that (between say 250 on the low end and 260 on the high end).
C > MAXH252 * .8
If you want it to actually be "no more", then you would include equality.
C >= MAXH252 * .8
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 10/7/2004 Posts: 794
|
Thank you have a great day
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |