Unlike the built-in version, you can configure how many bars it takes to confirm a fractal
. This indicator plots all Williams high and low fractals, and a stop line that trails the fractals up and down. Includes long and short stop alerts. You can choose whether the trail flips long-short based on the price being exceeded within a candle or on candle close. This indicator deals only with fractals and doesn't get into the Alligator
or anything else.
I've commented it extensively, so that it might be useful for people learning Pinescript. Enjoy!