script isEW3 {
input _mode = 0;
input abc = 0;
input d = 0;
input c = 0;
def _abc = abc >= .318 and abc <= .618 ; # These are the generally accepted levels,but you can expand these values to some other fib ratios as long as they aren't negative or over 1.
plot ret = _abc and (if _mode == 1 then d < c else d > c);
}
def u_EW31 = showPatterns and isEW3(-1, abc, bcd, d, c) and isEW3(-1, abc, bcd, d, c)[1] == 0;
AddChartBubble(u_EW31[-2] , high, "Bear EW3", Color.RED, yes);
def u_EW32 = showPatterns and isEW3(1, abc, bcd, d, c) and isEW3(1, abc, bcd, d, c)[1] == 0;
AddChartBubble(u_abcd2[-2] , low, "Bull W3" , Color.GREEN, no);