Tool
Fibonacci Anchor
market.fibonacci_anchor
Inputs
A stream of swing pivots (highs and lows), normally fed from a zigzag or leg tool; the anchor leg is chosen from these turning points.
Outputs
A Fibonacci retracement/extension bundle — each level (0.0, 0.236, 0.382, 0.5, 0.618, 0.786, 1.0 and extensions) carried as a price you can tap individually to test for touches, bounces, or breaks.
Fibonacci Anchor selects the one price swing (a “leg”) that every Fibonacci calculation should hang off, and emits that leg plus its two real pivot endpoints. Wire it into Fibonacci Retracement, OTE, Expansion/Projection or Cluster so they all measure the SAME swing.
How it works
It reads swing pivots from the connected zigzag input, picks one leg according to leg_direction and leg_select, and emits that leg (plus its start and end pivots) unchanged — it computes no Fibonacci levels itself; the downstream retracement / OTE / projection nodes do the ratio math on the leg it hands them. The mode setting decides whether it anchors to the last fully confirmed leg or re-anchors live to the leg still forming.
Modes
Mode options
Anchors the levels only to a leg whose swing high and low are both finalized, so the lines stop moving once the leg completes.
When to use: The stable default — use it when you want levels that never shift under your feet during a backtest or live trade.
Re-anchors to the most recent leg as it forms, so the levels move and re-draw while the newest swing is still developing.
When to use: When you want the freshest possible levels and accept that they repaint until the leg confirms.
Leg direction options
Forces the anchor onto an upward leg (swing low up to swing high), so 0% sits at the high and 100% at the low — the classic long-side retracement layout.
When to use: When you only want to map pullbacks inside up-moves.
Forces the anchor onto a downward leg (swing high down to swing low), so 0% sits at the low and 100% at the high — the short-side retracement layout.
When to use: When you only want to map pullbacks inside down-moves.
Lets the tool pick the leg direction on its own from the latest swing structure, anchoring up or down to match the most recent move.
When to use: The hands-off choice when you want levels on whichever way the market just swung.
Leg select options
Anchors to the strong impulse leg (the dominant directional swing), spreading retracement levels across the move you expect price to pull back into.
When to use: Standard Fibonacci retracement workflow — measure the impulse, wait for the pullback into 0.5/0.618.
Anchors to the counter-trend retrace leg instead, projecting extension targets for where the next impulse may run.
When to use: Projection / target work — measure the pullback to extend levels in the trend direction.
Configuration
Whether the levels anchor to the last fully confirmed leg (stable, non-repainting) or re-anchor live to the leg still forming (fresher but repaints).
Which leg orientation to anchor on: 'up' (low→high), 'down' (high→low), or 'auto' to follow the latest swing direction.
Which leg of the swing to measure: 'impulse' for the dominant directional move (retracements) or 'retrace' for the counter-trend leg (extensions/projections).
How many bars back the tool scans for swing pivots when choosing the leg; larger values reach for bigger, slower swings.
The smallest leg size, in points, that qualifies for anchoring — legs shorter than this are ignored so tiny wiggles don't draw levels.
The price size of one point for this symbol, used to convert min_leg_points into an actual price distance (e.g. 0.0001 for a 5-digit FX pair).
Connects to
Examples
- Feed a zigzag's pivots in, pick leg_select 'impulse' with leg_direction 'auto', then read interpretor.fibonacci_level to fire when price reaches the 0.618 retracement.
- Use leg_select 'retrace' to project extension targets and gate take-profit logic at the 1.272 / 1.618 levels.
Common mistakes
- Leaving mode on 'latest' and trusting the levels for entries — they repaint until the leg confirms, so backtests can look better than reality.
- Setting min_leg_points too small so the tool anchors to insignificant wiggles and draws levels on noise.