Custom Bar count in Fractals

Hello everyone,

We know fractals update after 2 bars when a bar has 2 lower highs or 2 higher lows on each side.
This means the total bars will be 5 (2 on each side and one on which fractal is painted).
So I was wondering if anyone knows a custom fractal indi in which this value can be changed.
I would like a fractal to be drawn only after 10 bars. This means it should have 10 higher lows or lower highs on each side before it paints.

I think we can also put it this way. We want the highest high or lowest low of the previous 21 bars.
Is that the same?

Currently, I do this by manually counting the bars and putting arrows at these ‘valid’ fractals. It gets really boring really quickly.
Any kind of help is appreciated.

Thanks
-Azz

EDIT: attached a souce code i found in the Mql4 code bade. Hope someone can edit.