Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 7/29/2010 Posts: 417
|
Hi Bruce,
I am experimenting with something and would like a pcf to count bars where RSI14 >70.
I would like this for V12.5.
Thank you.
Don
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Let's say you wanted to count how many bars this was true in v17+, you could use the CountTrue function.
CountTrue(RSI14 > 70, 10)
Unfortunately in earlier versions of TC2000 such as 12.5, you will need to manually check each bar in the formula.
ABS(RSI14 > 70) - (RSI14.1.1 > 70) - (RSI14.1.2 > 70) - (RSI14.1.3 > 70) - (RSI14.1.4 > 70) - (RSI14.1.5 > 70) - (RSI14.1.6 > 70) - (RSI14.1.7 > 70) - (RSI14.1.8 > 70) - (RSI14.1.9 > 70)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 7/29/2010 Posts: 417
|
Bruce,
Thank you.
I cannot get the 12.5 pcf to work. I get an error of argument missing near >.
Don
|
|
Registered User Joined: 7/29/2010 Posts: 417
|
Bruce,
I can now get it to work but somehow the formula keeps counting even when the RSI14 dips below 70.
|
|
Registered User Joined: 7/29/2010 Posts: 417
|
The formula doesn't reset to 0 when the RSI14 drops below 70
|
|
Registered User Joined: 7/29/2010 Posts: 417
|
Bruce,
I should have said that I wanted TrueInRow for v12.5 not count true.
I want to know consecutive bars where RSI14>70.
Sorry for my lack of clarity.
Don
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
No, it just counts the number of bars where RSI14 > 70 in the most recent 10 bars.
If you want the number of bars in a row where RSI14 > 70 in v17+, it would be almost as simple as the count version.
TrueInRow(RSI14 > 70, 10)
But the formula is quite a bit more complicated than just counting for earlier versions of TC2000.
ABS(RSI14 > 70) * (ABS(RSI14.1.1 <= 70) + ABS(RSI14.1.1 > 70) * (ABS(RSI14.1.2 <= 70) * 2 + ABS(RSI14.1.2 > 70) * (ABS(RSI14.1.3 <= 70) * 3 + ABS(RSI14.1.3 > 70) * (ABS(RSI14.1.4 <= 70) * 4 + ABS(RSI14.1.4 > 70) * (ABS(RSI14.1.5 <= 70) * 5 + ABS(RSI14.1.5 > 70) * (ABS(RSI14.1.6 <= 70) * 6 + ABS(RSI14.1.6 > 70) * (ABS(RSI14.1.7 <= 70) * 7 + ABS(RSI14.1.7 > 70) * (ABS(RSI14.1.8 <= 70) * 8 + ABS(RSI14.1.8 > 70) * (ABS(RSI14.1.9 <= 70) * 9 + ABS(RSI14.1.9 > 70) * 10)))))))))
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 7/29/2010 Posts: 417
|
Bruce,
That works great.
Thank you very much.
Don
|
|
Registered User Joined: 7/29/2010 Posts: 417
|
Bruce,
How would an additional True in row pcf for v12.5 look if I wanted RSI14 =70 instead of RSI14 >70.
I am unable to adapt the RSI14 >70 correctly.
Thank you.
Don
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
How many bars in a row RSI14 is exactly equal to 70? Are you sure? It seems like it is going to be pretty rare for this to happen at all, let alone multiple bars in a row.
ABS(RSI14 = 70) * (ABS(RSI14.1.1 <> 70) + ABS(RSI14.1.1 = 70) * (ABS(RSI14.1.2 <> 70) * 2 + ABS(RSI14.1.2 = 70) * (ABS(RSI14.1.3 <> 70) * 3 + ABS(RSI14.1.3 = 70) * (ABS(RSI14.1.4 <> 70) * 4 + ABS(RSI14.1.4 = 70) * (ABS(RSI14.1.5 <> 70) * 5 + ABS(RSI14.1.5 = 70) * (ABS(RSI14.1.6 <> 70) * 6 + ABS(RSI14.1.6 = 70) * (ABS(RSI14.1.7 <> 70) * 7 + ABS(RSI14.1.7 = 70) * (ABS(RSI14.1.8 <> 70) * 8 + ABS(RSI14.1.8 = 70) * (ABS(RSI14.1.9 <> 70) * 9 + ABS(RSI14.1.9 = 70) * 10)))))))))
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |