This script detects the classic Head and Shoulders pattern, a reliable reversal pattern in technical analysis. It identifies the left shoulder, head, and right shoulder peaks, along with the neckline, to signal potential trend reversals. The script plots the pattern on the chart and triggers alerts when the conditions for the pattern are met. Ideal for traders looking to automate pattern detection and stay ahead of market shifts.