Automatically detects swing highs and lows to draw dynamic Fibonacci retracements with emphasized 0.618 - 0.65 Golden Pocket zones.
Copy and paste this code directly into your TradingView Pine Editor
//@version=5
indicator("FxSnip - Auto Fibonacci Golden Pocket", "FxSnip Auto Fib", overlay=true)
len = input.int(20, "Swing Pivot Lookback")
h = ta.highest(high, len)
l = ta.lowest(low, len)
rangePrice = h - l
fib382 = h - (rangePrice * 0.382)
fib500 = h - (rangePrice * 0.500)
fib618 = h - (rangePrice * 0.618)
fib650 = h - (rangePrice * 0.650)
fib786 = h - (rangePrice * 0.786)
plot(h, "Swing High (1.0)", color=color.gray, style=plot.style_stepline)
plot(fib382, "Fib 0.382", color=color.blue, style=plot.style_stepline)
plot(fib500, "Fib 0.500 Equilibrium", color=color.purple, style=plot.style_stepline)
plot(fib618, "Golden Pocket 0.618", color=color.yellow, linewidth=2, style=plot.style_stepline)
plot(fib650, "Golden Pocket 0.650", color=color.orange, linewidth=2, style=plot.style_stepline)
plot(fib786, "Fib 0.786", color=color.teal, style=plot.style_stepline)
plot(l, "Swing Low (0.0)", color=color.gray, style=plot.style_stepline)
.ex5 / .mq5 file.Never draw manual Fibonacci retracements again. The Auto Fibonacci Golden Pocket Indicator dynamically plots 0.382, 0.50, 0.618, 0.65 (Golden Pocket), and 0.786 retracement and extension targets.
Need this indicator converted into an automated MT5 Expert Advisor or customized for your specific trading rules?
Order Custom Coding →Loading activity...
Just now