Can you write a Typescript zigzag indicator that takes depth, deviation, and backstep into account as described below? 

The “Depth” is the first set up of the technical indicator Zigzag. It is the minimum number of bars without a second maximum or minimum deviation of the bar (example: if we have a maximum in candle x, and the depth is 12, it won’t be able to draw the following maximum until at least x+12 candles).
The “Deviation” is the percentage once the previous maximum or minimum is formed (example: if we have a stretch of 100 points from the minimum to the maximum, and the deviation is 5, it will start to draw the bearish stretch when at least 5% of the stretch is corrected).
The “Backstep” is the last set up and it reflects the minimum amount of bars between which the maximums and minimums can be drawn (example: if we have a maximum in the candle x, and the backstep is 3, it won’t be able to draw the next stretch of minimum until the next x+3 candles).

The Zig Zag Indicator Formula
​	  
ZigZag(HL,%change=X,retrace=FALSE,
LastExtreme=TRUE)
If %change>=X,plot ZigZag
where:
HL=High-Low price series or Closing price series
%change=Minimum price movement, in percentage
Retrace=Is change a retracement of the previous
move or an absolute change from peak to trough?
LastExtreme=If the extreme price is the same over
multiple periods, is the extreme price the first or
last observation?
​	 Add stress words which are capitalized. Limit those stress words for less than 17 times.
user