SimpleCryptoLife

Williams Fractal Trailing Stops

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!
Release Notes: Removed a stray unnecessary input to the f_flip function.
Added comment to f_trail function to make it more portable.
Release Notes: Fixed description of the _longTrail and _shortTrail variables.
Fixed edge cases where a wick causes us to try to flip both long and short.
Release Notes: Small fix to display the current stop price at the level of the stop itself, not just under or above the bar.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Comments

Amazing work
100 coins
Reply
@djmad, Thank you!
Reply
500 coins
Reply
@PineCoders, Thanks very much!
Reply
can use it for any time frame
+2 Reply
@naba_naif, Yes, you can. Although market structure will be less clear and chop more prevalent on really small timeframes. Also on assets with very low prices for their denominations (like very low-sat cryptos) it will not magically create sensible market structure where there is none. Hope this helps.
+1 Reply
I'm going to paper trade and see what happens.
+1 Reply
This publication will be featured in our "Best Scripts of The Month" selection. Thank you for your valuable contribution to the TradingView community, and congrats!
+1 Reply
@PineCoders, Thanks very much!
Reply
First I want to thank you for this script, and this is the best . I am looking for auto trading bot using this strategy, can you make one?
Reply
Home Stock Screener Forex Screener Crypto Screener Economic Calendar About Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter