One big difference is the technique.
In my formula I'm using the idea that if a boolean (true or false) inside an ABS() function will return 1 if true and 0 if false. I then multiply that by the volume and compare this numeric result directly with the current volume.
So on each of the 10-prior days I'm comparing the current volume to the prior volume when the net change is down and the current volume to zero otherwise.
Broken down by individual day it would look like:
C > C1 AND
V > ABS(C1 < C2) * V1 AND
V > ABS(C2 < C3) * V2 AND
V > ABS(C3 < C4) * V3 AND
V > ABS(C4 < C5) * V4 AND
V > ABS(C5 < C6) * V5 AND
V > ABS(C6 < C7) * V6 AND
V > ABS(C7 < C8) * V7 AND
V > ABS(C8 < C9) * V8 AND
V > ABS(C9 < C10) * V9 AND
V > ABS(C10 < C11) * V10
Your version compares the current volume to the prior volume in all cases but tries to only return true when the net change is negative and the current volume is greater than the volume of the bar.
There are some parentheses issues which prevent the order of operation from happening in the correct order and you counter condition checks for a positive net change instead of checking for the net change to be greater than or equal to zero.
Adjusting the parentheses a bit to both force the order of operations and make the order obvious would result in:
C > C1 AND
(C1 >= C2 OR (C1 < C2 AND V > V1)) AND
(C2 >= C3 OR (C2 < C3 AND V > V2)) AND
(C3 >= C4 OR (C3 < C4 AND V > V3)) AND
(C4 >= C5 OR (C4 < C5 AND V > V4)) AND
(C5 >= C6 OR (C5 < C6 AND V > V5)) AND
(C5 >= C7 OR (C6 < C7 AND V > V6)) AND
(C7 >= C8 OR (C7 < C8 AND V > V7)) AND
(C8 >= C9 OR (C8 < C9 AND V > V8)) AND
(C9 >= C10 OR (C9 < C10 AND V > V9)) AND
(C10 >= C11 OR (C10 < C11 AND V > V10))
I must be missing a typo in there somewhere though. It still doesn't return true on every bar where I think it should.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|