OPEN-SOURCE SCRIPT
Auto Fibonacci Levels

Auto Fibonacci Levels is a dual Fibonacci retracement indicator that automatically detects swing highs and swing lows and plots Fibonacci levels between them in real time — no manual drawing required. It runs two completely independent Fibonacci sets simultaneously, allowing you to track retracements across two different swing sizes at the same time.
How It Works:
The indicator uses a pivot detection algorithm that scans a defined number of bars to identify the most recent significant swing high and swing low. Once a swing is identified, an anchor line is drawn connecting the two points, and Fibonacci retracement levels are automatically calculated and plotted from that range. As new swings form, the levels update dynamically.
Settings Breakdown:
Pivot Sensitivity - Controls how many bars back the indicator looks to identify a swing high or low. Lower values detect smaller, more frequent swings. Higher values require larger price moves before registering a new swing. Accepts any value from 1 to 500.
Show Anchor Line - Toggles the visibility of the diagonal line connecting the swing high and swing low. The anchor line visually represents the range the Fibonacci levels are drawn from.
Line Color - Sets the color of the anchor line.
Line Style - Sets the style of the anchor line — Solid, Dashed, or Dotted.
Line Thickness - Sets the thickness of the anchor line from 1 to 5.
Show Levels - Master toggle that turns all Fibonacci level lines on or off at once without affecting the anchor line.
Extend Level Lines - When enabled, stretches all Fibonacci level lines leftward to the beginning of the anchor line, so the levels span the full width of the detected swing range rather than only appearing at the right side of the chart.
Individual Levels (0, 0.236, 0.382, 0.5, 0.618, 0.786, 1.0) - Each level has its own show/hide toggle, adjustable value, and color picker. This allows you to display only the levels you trade with and color-code them however you prefer. Values are fully editable so you can substitute any custom retracement or extension levels you want.
Show Recent Fib Levels - When enabled, displays the previous Fibonacci sets from recently completed swings alongside the current active set. Historical sets are rendered progressively more transparent the older they are, making it easy to distinguish past ranges from the current one. Anchor lines are included for each historical set.
Recent Fib Count - Controls how many previous Fibonacci sets are displayed, from 1 to 5. Only fully completed swings are shown — the current active set is never duplicated.
Final Notes:
Both Fibonacci sets are fully independent and can be configured separately. The indicator is non-repainting within its current bar — levels update as new swings are confirmed. Works on all timeframes and all asset classes
How It Works:
The indicator uses a pivot detection algorithm that scans a defined number of bars to identify the most recent significant swing high and swing low. Once a swing is identified, an anchor line is drawn connecting the two points, and Fibonacci retracement levels are automatically calculated and plotted from that range. As new swings form, the levels update dynamically.
Settings Breakdown:
Pivot Sensitivity - Controls how many bars back the indicator looks to identify a swing high or low. Lower values detect smaller, more frequent swings. Higher values require larger price moves before registering a new swing. Accepts any value from 1 to 500.
Show Anchor Line - Toggles the visibility of the diagonal line connecting the swing high and swing low. The anchor line visually represents the range the Fibonacci levels are drawn from.
Line Color - Sets the color of the anchor line.
Line Style - Sets the style of the anchor line — Solid, Dashed, or Dotted.
Line Thickness - Sets the thickness of the anchor line from 1 to 5.
Show Levels - Master toggle that turns all Fibonacci level lines on or off at once without affecting the anchor line.
Extend Level Lines - When enabled, stretches all Fibonacci level lines leftward to the beginning of the anchor line, so the levels span the full width of the detected swing range rather than only appearing at the right side of the chart.
Individual Levels (0, 0.236, 0.382, 0.5, 0.618, 0.786, 1.0) - Each level has its own show/hide toggle, adjustable value, and color picker. This allows you to display only the levels you trade with and color-code them however you prefer. Values are fully editable so you can substitute any custom retracement or extension levels you want.
Show Recent Fib Levels - When enabled, displays the previous Fibonacci sets from recently completed swings alongside the current active set. Historical sets are rendered progressively more transparent the older they are, making it easy to distinguish past ranges from the current one. Anchor lines are included for each historical set.
Recent Fib Count - Controls how many previous Fibonacci sets are displayed, from 1 to 5. Only fully completed swings are shown — the current active set is never duplicated.
Final Notes:
Both Fibonacci sets are fully independent and can be configured separately. The indicator is non-repainting within its current bar — levels update as new swings are confirmed. Works on all timeframes and all asset classes
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.