OPEN-SOURCE SCRIPT

Auto Fibonacci Levels

917
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

免責事項

これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。