Registered User Joined: 12/2/2004 Posts: 17
|
Need the formula for getting the number of days since the lates Max High
(e.g., number of days since MaxH50).
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
An Indicator Formula for the number of bars since the high was at the current 50-bar high could be written as follows.
ABS(H < MAXH50) * (ABS(H1 = MAXH50) + ABS(H1 < MAXH50) * (ABS(H2 = MAXH50) * 2 + ABS(H2 < MAXH50) * (ABS(H3 = MAXH50) * 3 + ABS(H3 < MAXH50) * (ABS(H4 = MAXH50) * 4 + ABS(H4 < MAXH50) * (ABS(H5 = MAXH50) * 5 + ABS(H5 < MAXH50) * (ABS(H6 = MAXH50) * 6 + ABS(H6 < MAXH50) * (ABS(H7 = MAXH50) * 7 + ABS(H7 < MAXH50) * (ABS(H8 = MAXH50) * 8 + ABS(H8 < MAXH50) * (ABS(H9 = MAXH50) * 9 + ABS(H9 < MAXH50) * (ABS(H10 = MAXH50) * 10 + ABS(H10 < MAXH50) * (ABS(H11 = MAXH50) * 11 + ABS(H11 < MAXH50) * (ABS(H12 = MAXH50) * 12 + ABS(H12 < MAXH50) * (ABS(H13 = MAXH50) * 13 + ABS(H13 < MAXH50) * (ABS(H14 = MAXH50) * 14 + ABS(H14 < MAXH50) * (ABS(H15 = MAXH50) * 15 + ABS(H15 < MAXH50) * (ABS(H16 = MAXH50) * 16 + ABS(H16 < MAXH50) * (ABS(H17 = MAXH50) * 17 + ABS(H17 < MAXH50) * (ABS(H18 = MAXH50) * 18 + ABS(H18 < MAXH50) * (ABS(H19 = MAXH50) * 19 + ABS(H19 < MAXH50) * (ABS(H20 = MAXH50) * 20 + ABS(H20 < MAXH50) * (ABS(H21 = MAXH50) * 21 + ABS(H21 < MAXH50) * (ABS(H22 = MAXH50) * 22 + ABS(H22 < MAXH50) * (ABS(H23 = MAXH50) * 23 + ABS(H23 < MAXH50) * (ABS(H24 = MAXH50) * 24 + ABS(H24 < MAXH50) * (ABS(H25 = MAXH50) * 25 + ABS(H25 < MAXH50) * (ABS(H26 = MAXH50) * 26 + ABS(H26 < MAXH50) * (ABS(H27 = MAXH50) * 27 + ABS(H27 < MAXH50) * (ABS(H28 = MAXH50) * 28 + ABS(H28 < MAXH50) * (ABS(H29 = MAXH50) * 29 + ABS(H29 < MAXH50) * (ABS(H30 = MAXH50) * 30 + ABS(H30 < MAXH50) * (ABS(H31 = MAXH50) * 31 + ABS(H31 < MAXH50) * (ABS(H32 = MAXH50) * 32 + ABS(H32 < MAXH50) * (ABS(H33 = MAXH50) * 33 + ABS(H33 < MAXH50) * (ABS(H34 = MAXH50) * 34 + ABS(H34 < MAXH50) * (ABS(H35 = MAXH50) * 35 + ABS(H35 < MAXH50) * (ABS(H36 = MAXH50) * 36 + ABS(H36 < MAXH50) * (ABS(H37 = MAXH50) * 37 + ABS(H37 < MAXH50) * (ABS(H38 = MAXH50) * 38 + ABS(H38 < MAXH50) * (ABS(H39 = MAXH50) * 39 + ABS(H39 < MAXH50) * (ABS(H40 = MAXH50) * 40 + ABS(H40 < MAXH50) * (ABS(H41 = MAXH50) * 41 + ABS(H41 < MAXH50) * (ABS(H42 = MAXH50) * 42 + ABS(H42 < MAXH50) * (ABS(H43 = MAXH50) * 43 + ABS(H43 < MAXH50) * (ABS(H44 = MAXH50) * 44 + ABS(H44 < MAXH50) * (ABS(H45 = MAXH50) * 45 + ABS(H45 < MAXH50) * (ABS(H46 = MAXH50) * 46 + ABS(H46 < MAXH50) * (ABS(H47 = MAXH50) * 47 + ABS(H47 < MAXH50) * (ABS(H48 = MAXH50) * 48 + ABS(H48 < MAXH50) * (ABS(H49 = MAXH50) * 49)))))))))))))))))))))))))))))))))))))))))))))))))
Days Since Last Peak (or other day-counting needs)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|