Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Counting bars pcf Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
donv98
Posted : Monday, November 21, 2016 5:40:05 PM
Registered User
Joined: 7/29/2010
Posts: 417

Bruce,

  

I have a pcf that counts the number of bars where the 8ema is falling.

Please create a pcf which counts  the number bars where the 8ema falling bars is 0.

Thank you.

Don

StockGuy
Posted : Tuesday, November 22, 2016 7:22:48 AM

Administration

Joined: 9/30/2004
Posts: 9,187

Post your PCF that counts the number of bars where the 8ema is falling and we can build from that.

donv98
Posted : Tuesday, November 22, 2016 10:41:58 AM
Registered User
Joined: 7/29/2010
Posts: 417

8 ema falling bars pcf

 

ABS(XAVGC8 < XAVGC8.1) * (ABS(XAVGC8.1 >= XAVGC8.2) + ABS(XAVGC8.1 < XAVGC8.2) * (ABS(XAVGC8.2 >= XAVGC8.3) * 2 + ABS(XAVGC8.2 < XAVGC8.3) * (ABS(XAVGC8.3 >= XAVGC8.4) * 3 + ABS(XAVGC8.3 < XAVGC8.4) * (ABS(XAVGC8.4 >= XAVGC8.5) * 4 + ABS(XAVGC8.4 < XAVGC8.5) * (ABS(XAVGC8.5 >= XAVGC8.6) * 5 + ABS(XAVGC8.5 < XAVGC8.6) * (ABS(XAVGC8.6 >= XAVGC8.7) * 6 + ABS(XAVGC8.6 < XAVGC8.7) * (ABS(XAVGC8.7 >= XAVGC8.8) * 7 + ABS(XAVGC8.7 < XAVGC8.8) * (ABS(XAVGC8.8 >= XAVGC8.9) * 8 + ABS(XAVGC8.8 < XAVGC8.9) * (ABS(XAVGC8.9 >= XAVGC8.10) * 9 + ABS(XAVGC8.9 < XAVGC8.10) * (ABS(XAVGC8.10 >= XAVGC8.11) * 10 + ABS(XAVGC8.10 < XAVGC8.11) * (ABS(XAVGC8.11 >= XAVGC8.12) * 11 + ABS(XAVGC8.11 < XAVGC8.12) * (ABS(XAVGC8.12 >= XAVGC8.13) * 12 + ABS(XAVGC8.12 < XAVGC8.13) * (ABS(XAVGC8.13 >= XAVGC8.14) * 13 + ABS(XAVGC8.13 < XAVGC8.14) * (ABS(XAVGC8.14 >= XAVGC8.15) * 14 + ABS(XAVGC8.14 < XAVGC8.15) * (ABS(XAVGC8.15 >= XAVGC8.16) * 15 + ABS(XAVGC8.15 < XAVGC8.16) * (ABS(XAVGC8.16 >= XAVGC8.17) * 16 + ABS(XAVGC8.16 < XAVGC8.17) * (ABS(XAVGC8.17 >= XAVGC8.18) * 17 + ABS(XAVGC8.17 < XAVGC8.18) * (ABS(XAVGC8.18 >= XAVGC8.19) * 18 + ABS(XAVGC8.18 < XAVGC8.19) * (ABS(XAVGC8.19 >= XAVGC8.20) * 19 + ABS(XAVGC8.19 < XAVGC8.20) * (ABS(XAVGC8.20 >= XAVGC8.21) * 20 + ABS(XAVGC8.20 < XAVGC8.21) * (ABS(XAVGC8.21 >= XAVGC8.22) * 21 + ABS(XAVGC8.21 < XAVGC8.22) * (ABS(XAVGC8.22 >= XAVGC8.23) * 22 + ABS(XAVGC8.22 < XAVGC8.23) * (ABS(XAVGC8.23 >= XAVGC8.24) * 23 + ABS(XAVGC8.23 < XAVGC8.24) * (ABS(XAVGC8.24 >= XAVGC8.25) * 24 + ABS(XAVGC8.24 < XAVGC8.25) * (ABS(XAVGC8.25 >= XAVGC8.26) * 25 + ABS(XAVGC8.25 < XAVGC8.26) * (ABS(XAVGC8.26 >= XAVGC8.27) * 26 + ABS(XAVGC8.26 < XAVGC8.27) * (ABS(XAVGC8.27 >= XAVGC8.28) * 27 + ABS(XAVGC8.27 < XAVGC8.28) * (ABS(XAVGC8.28 >= XAVGC8.29) * 28 + ABS(XAVGC8.28 < XAVGC8.29) * (ABS(XAVGC8.29 >= XAVGC8.30) * 29 + ABS(XAVGC8.29 < XAVGC8.30) * 30)))))))))))))))))))))))))))))

Bruce_L
Posted : Wednesday, November 23, 2016 9:11:20 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

I'm not sure I'm understand the question correctly, but if you just want to count the number of bars in a row where your current formula returns 0, you should be able to just switch the < signs with the >= signs.

ABS(XAVGC8 >= XAVGC8.1) * (ABS(XAVGC8.1 < XAVGC8.2) + ABS(XAVGC8.1 >= XAVGC8.2) * (ABS(XAVGC8.2 < XAVGC8.3) * 2 + ABS(XAVGC8.2 >= XAVGC8.3) * (ABS(XAVGC8.3 < XAVGC8.4) * 3 + ABS(XAVGC8.3 >= XAVGC8.4) * (ABS(XAVGC8.4 < XAVGC8.5) * 4 + ABS(XAVGC8.4 >= XAVGC8.5) * (ABS(XAVGC8.5 < XAVGC8.6) * 5 + ABS(XAVGC8.5 >= XAVGC8.6) * (ABS(XAVGC8.6 < XAVGC8.7) * 6 + ABS(XAVGC8.6 >= XAVGC8.7) * (ABS(XAVGC8.7 < XAVGC8.8) * 7 + ABS(XAVGC8.7 >= XAVGC8.8) * (ABS(XAVGC8.8 < XAVGC8.9) * 8 + ABS(XAVGC8.8 >= XAVGC8.9) * (ABS(XAVGC8.9 < XAVGC8.10) * 9 + ABS(XAVGC8.9 >= XAVGC8.10) * (ABS(XAVGC8.10 < XAVGC8.11) * 10 + ABS(XAVGC8.10 >= XAVGC8.11) * (ABS(XAVGC8.11 < XAVGC8.12) * 11 + ABS(XAVGC8.11 >= XAVGC8.12) * (ABS(XAVGC8.12 < XAVGC8.13) * 12 + ABS(XAVGC8.12 >= XAVGC8.13) * (ABS(XAVGC8.13 < XAVGC8.14) * 13 + ABS(XAVGC8.13 >= XAVGC8.14) * (ABS(XAVGC8.14 < XAVGC8.15) * 14 + ABS(XAVGC8.14 >= XAVGC8.15) * (ABS(XAVGC8.15 < XAVGC8.16) * 15 + ABS(XAVGC8.15 >= XAVGC8.16) * (ABS(XAVGC8.16 < XAVGC8.17) * 16 + ABS(XAVGC8.16 >= XAVGC8.17) * (ABS(XAVGC8.17 < XAVGC8.18) * 17 + ABS(XAVGC8.17 >= XAVGC8.18) * (ABS(XAVGC8.18 < XAVGC8.19) * 18 + ABS(XAVGC8.18 >= XAVGC8.19) * (ABS(XAVGC8.19 < XAVGC8.20) * 19 + ABS(XAVGC8.19 >= XAVGC8.20) * (ABS(XAVGC8.20 < XAVGC8.21) * 20 + ABS(XAVGC8.20 >= XAVGC8.21) * (ABS(XAVGC8.21 < XAVGC8.22) * 21 + ABS(XAVGC8.21 >= XAVGC8.22) * (ABS(XAVGC8.22 < XAVGC8.23) * 22 + ABS(XAVGC8.22 >= XAVGC8.23) * (ABS(XAVGC8.23 < XAVGC8.24) * 23 + ABS(XAVGC8.23 >= XAVGC8.24) * (ABS(XAVGC8.24 < XAVGC8.25) * 24 + ABS(XAVGC8.24 >= XAVGC8.25) * (ABS(XAVGC8.25 < XAVGC8.26) * 25 + ABS(XAVGC8.25 >= XAVGC8.26) * (ABS(XAVGC8.26 < XAVGC8.27) * 26 + ABS(XAVGC8.26 >= XAVGC8.27) * (ABS(XAVGC8.27 < XAVGC8.28) * 27 + ABS(XAVGC8.27 >= XAVGC8.28) * (ABS(XAVGC8.28 < XAVGC8.29) * 28 + ABS(XAVGC8.28 >= XAVGC8.29) * (ABS(XAVGC8.29 < XAVGC8.30) * 29 + ABS(XAVGC8.29 >= XAVGC8.30) * 30)))))))))))))))))))))))))))))



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
donv98
Posted : Wednesday, November 23, 2016 11:10:30 AM
Registered User
Joined: 7/29/2010
Posts: 417

Bruce,

   Thank you.

That is exactly what I was looking for.

Have a happy Thanksgiving!

Don

Bruce_L
Posted : Wednesday, November 23, 2016 11:14:12 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

You're welcome. Happy Thanksgiving!



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Boca Bill
Posted : Saturday, December 3, 2016 9:02:08 PM
Registered User
Joined: 5/27/2016
Posts: 5

QUOTE (donv98)

Bruce,

  

I have a pcf that counts the number of bars where the 8ema is falling.

Please create a pcf which counts  the number bars where the 8ema falling bars is 0.

Thank you.

Don

 

Dony,

What does this accomplish for you?  I'm not a code writer and do not get what you are looking for.

donv98
Posted : Monday, December 5, 2016 5:15:41 PM
Registered User
Joined: 7/29/2010
Posts: 417

If the number bars where the 8ema falling bars is 0, then the 8ema must be rising or flat.

So this allows me to easily see this on the chart.

You may want to try it out for yourself with some indicator you find useful.

Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.