PROTECTED SOURCE SCRIPT
Fibonacci extension overlay

A lightweight Fibonacci extension overlay that anchors to the most recent confirmed swing (two pivots) and plots one clean set of levels. Built for Pine v5 with no external libraries, it’s stable, fast, and easy to customize.
How it works
Detects pivots using ta.pivothigh/ta.pivotlow.
Uses the last two confirmed pivots (previous → latest) to define the swing.
Computes signed distance of the swing and draws extension levels anchored to the last pivot.
Lines extend to the right by default so levels stay visible as new bars print.
Inputs & options
Depth – sensitivity of pivot detection (smaller = more swings, larger = fewer).
Reverse – flip extension direction.
Extend Left / Right – control how far lines extend past the swing.
Show Levels / Show Prices – toggle text formatting on labels.
Labels Position – left or right of the swing.
Fill between levels (optional) – background fill between adjacent levels.
Background Transparency – opacity of any fills.
Tips
If nothing appears, reduce Depth or wait for two confirmed pivots on the current timeframe.
Works on any market and timeframe; lower TFs usually benefit from smaller Depth.
Because pivots are confirmed, plotted levels do not repaint once shown (they update only when a new pivot confirms).
Included levels
-0.65, -0.618, -0.382, -0.236, 0, 0.236, 0.382, 0.5, 0.618, 0.65, 0.786, 1, 1.272, 1.414, 1.618, 1.65, 2.618, 2.65, 3.618, 3.65, 4.236, 4.618
(Visibility, values, and colors are fully configurable.)
Notes
This script avoids duplicate drawings by updating persistent line/label objects instead of recreating them every bar.
Designed to be overlay-friendly and scale with the chart’s price axis.
How it works
Detects pivots using ta.pivothigh/ta.pivotlow.
Uses the last two confirmed pivots (previous → latest) to define the swing.
Computes signed distance of the swing and draws extension levels anchored to the last pivot.
Lines extend to the right by default so levels stay visible as new bars print.
Inputs & options
Depth – sensitivity of pivot detection (smaller = more swings, larger = fewer).
Reverse – flip extension direction.
Extend Left / Right – control how far lines extend past the swing.
Show Levels / Show Prices – toggle text formatting on labels.
Labels Position – left or right of the swing.
Fill between levels (optional) – background fill between adjacent levels.
Background Transparency – opacity of any fills.
Tips
If nothing appears, reduce Depth or wait for two confirmed pivots on the current timeframe.
Works on any market and timeframe; lower TFs usually benefit from smaller Depth.
Because pivots are confirmed, plotted levels do not repaint once shown (they update only when a new pivot confirms).
Included levels
-0.65, -0.618, -0.382, -0.236, 0, 0.236, 0.382, 0.5, 0.618, 0.65, 0.786, 1, 1.272, 1.414, 1.618, 1.65, 2.618, 2.65, 3.618, 3.65, 4.236, 4.618
(Visibility, values, and colors are fully configurable.)
Notes
This script avoids duplicate drawings by updating persistent line/label objects instead of recreating them every bar.
Designed to be overlay-friendly and scale with the chart’s price axis.
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 제한 없이 자유롭게 사용할 수 있습니다 — 여기에서 자세히 알아보기.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 제한 없이 자유롭게 사용할 수 있습니다 — 여기에서 자세히 알아보기.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.