This script identifies double top and double bottom chart patterns
It has many settings. For example, you can choose by which extremums you want to identify patterns - by the edges of wicks (tails, shadows), or by the edges of candle bodies.
The Sensitivity parameter will allow you to control the frequency of detected patterns, depending on whether you want the patterns to be detected more often, or if they cover a larger number of candles and thus be more reliable.
There are also several settings which you can determine the parameters of the pattern - the length and proportions of the lines included in it.