Corrected logic that was previously drawing bearish patterns. Please be advised that at the time of writing Scott Carney's Harmonic Patterns webpage is incorrectly showing bullish patterns as bearish patterns and vice versa. This will be changed in due course according to Scott, as will the description of this script. To confirm, all bullish harmonic patterns are M shapes and all bearish harmonic patterns are W shapes. Apologies for any confusion this may have caused.