Registered User Joined: 5/5/2015 Posts: 20
|
SinceTrue(b, x) -> returns -1 if Boolean Formula was not true in period, or bars since it was true, 0 being the current bar, and period-1 the max it will return
For not true in period, I would like to replace -1 with max return value.
This is the best I can think of:
(SinceTrue(b,x) = -1) * (x-1)
-
(SinceTrue(b,x) > -1) * SinceTrue(b,x)
It seems kind of long. Is there a more efficient way to accomplish the same?
thank you
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Use TrueInRow() with NOT() instead.
TrueInRow(NOT(b), x)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 5/5/2015 Posts: 20
|
Brilliant!
Thank you.
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|