Criteria1 is to paint the Strong bar, Criteria2 for the Weak bar.
Criteria1(close > h[1] and (h > h[2] or h > c[2]) and (h > h[3] or h > c[3])),
Criteria2(close < l[1] and (l < l[2] or l < c[2]) and (l < l[3] or l < c[3]));
where: c=close, h=high, l=low.... [1] means a bar ago, [2] 2 bars...