Registered User Joined: 11/6/2012 Posts: 3
|
I get an error message " divide by 0" to the following formulae and yet it appears to work
(O1>C1)AND(C>O)AND(C<=O1)AND(C1<=O)AND(O1-C1)/((.001+(H1-L1))>0.6)AND(C-O)/((.001+(C1-O1))<.6)ANDABS(O1-C1)>((ABS(O2-C2)+ABS(O3-C3)+ABS(O4-C4)+ABS(O5-C5)+ABS(O6-C6)+ABS(O7-C7)+ABS(O8-C8)+ABS(O9-C9)+ABS(O10-C10))/10)*1.3
The same error message for Hammer 'divide by 0"
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I'm not a candlestick guy (at all), but I would probably rewrite this as:
O1 >= C AND C > O AND O >= C1 AND O1 - C1 > (H1 - L1) * .6 AND C - O < (O1 - C1) * .6 AND O1 - C1 > 1.3 * (ABS(O2 - C2) + ABS(O3 - C3) + ABS(O4 - C4) + ABS(O5 - C5) + ABS(O6 - C6) + ABS(O7 - C7) + ABS(O8 - C8) + ABS(O9 - C9) + ABS(O10 - C10) + ABS(O11 - C11)) / 10
It attempts to avoid division and rearranges the parentheses significantly. If your hammer pattern looks like:
(H-L)>(3*abs(O-C))AND((C-L)/(.001+(H-L))>0.8)AND(O-L)/((.001+(H-L))>0.8)
I would make similar changes to get rid of the division:
H - L > 3 * ABS(O - C) AND C - L > (H - L) * .8 AND O - L > (H - L) * .8
-Bruce Personal Criteria Formulas TC2000 Support Articles
|