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 |

Since true pcf Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
dhirenshah
Posted : Thursday, November 2, 2017 1:58:57 PM
Registered User
Joined: 3/10/2012
Posts: 465

Hi Bruce 

Just wondering is there a better way to have counting bars from the time this below pcf was true 

IIF(V > V1 AND (H - L) / V < (H1 - L1) / V, (H - L) / V, 1 / 0)

Can you please help with new formula because i m getting error

thanks .

Dhiren

Bruce_L
Posted : Thursday, November 2, 2017 2:09:37 PM


Worden Trainer

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

The condition formula portion of your indicator formula is the following.

V > V1 AND (H - L) / V < (H1 - L1) / V

So, if you want to return the number of bars since this was true over the most recent 50 bars, you could use the following (which will return -1 if it is not true at all during the period).

SinceTrue(V > V1 AND (H - L) / V < (H1 - L1) / V, 50)

You can change the 50 near the end to adjust the number of bars being checked.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
dhirenshah
Posted : Thursday, November 2, 2017 2:43:48 PM
Registered User
Joined: 3/10/2012
Posts: 465

Thank you Bruce  for that breakdown 

 

Now using the same idea i m applying to this formula and its giving me error is missing period argument so whats wrong here ?

 

SinceTrue(L + H1) / 2 / ABS(L > H1), 50)

 

thanks

Bruce_L
Posted : Thursday, November 2, 2017 2:54:52 PM


Worden Trainer

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

I am not actually sure what you are trying to do, so I don't know for sure what is wrong. There are at least two issues however.

You don't have a condition in your formula except as the denominator of formula designed to return a numerica value. You have to have something that returns true or false as the first argument of the SinceTrue() function.

Your parentheses are mis-matched. You have 2 opening parentheses and 3 closing parentheses.

My best guess at your formula would be:

SinceTrue(L > H1, 50)

It just returns the number of bars since the Boolean instead the ABS() function of your formula returned true (assuming this happened during the most recent 50 bars).



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
dhirenshah
Posted : Thursday, November 2, 2017 3:37:18 PM
Registered User
Joined: 3/10/2012
Posts: 465

Ok thank you bruce 

Bruce_L
Posted : Thursday, November 2, 2017 3:39:46 PM


Worden Trainer

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

You're welcome.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
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.