Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
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
|
|
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
|
|
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
|
|
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
|
|
Registered User Joined: 3/10/2012 Posts: 465
|
Ok thank you bruce
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |