Registered User Joined: 8/2/2014 Posts: 12
|
Is there a formula that would show the greatest number of consecutive up or down days for an instrument in the last 252 days?
|
Registered User Joined: 8/2/2014 Posts: 12
|
And to folow up, would there be a way to scan for instruments whose current "Streak" matches or is -1 from the 252 day streak-high?
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The answer to the first queqstion really depends on if you want to check for a streak ending within those 252 trading days. This maxes out at 50 bars in a row, You can change this if you want, but it seems to be large enough to work for most things besides symbols like the FX symbols which always go up.
MAX(TrueInRow(C <> C1 AND SGN(C - C1) = SGN(C - C2), 50), 252)
Or if you want the streak to be entirely containing within the 252 trading day span. I can't think of a method which is short and fast enough to be practical for this second interpretation.
Assuming the first interpretation works, a formula for the second question could be written as follows.
TrueInRow(C <> C1 AND SGN(C - C1) = SGN(C - C2), 50) >= MAX(TrueInRow(C <> C1 AND SGN(C - C1) = SGN(C - C2), 50), 252) - 1
-Bruce Personal Criteria Formulas TC2000 Support Articles
|