Tool
Fibonacci Fan
calc.fibonacci_fan
Inputs
The leg the fan radiates from — wire the Fibonacci Anchor's leg or any zigzag leg. Sparse legs (pattern matches) are forward-filled to the last confirmed one.
Optional per-bar price tested against each ray — usually the bar close. Left unwired, the above/below gates simply stay false while the ray prices still flow.
Outputs
A bundle with a per-bar validity gate, the leg direction, one ray price per active slot (a wireable price handle — cross it with close for ride/break, or feed order TP/SL), and above_N / below_N gates that read the optional price input.
Fibonacci Fan draws MT5's classic fan rays for one leg: straight lines from the leg's start pivot through its 38.2 / 50 / 61.8 retracement levels at the leg's end, extended forward. Each ray's per-bar price is a wireable handle, and above/below gates tell you which side of a ray price is on.
How it works
Wire it a leg (the Fibonacci Anchor's output, or any zigzag leg — sparse legs are forward-filled to the last confirmed one). For each active slot the tool computes the anchor level with the family formula price = end + (start − end) × (pct / 100), then draws the straight line from the start pivot through that level at the leg's end bar: fan_i[t] = start + (level_i − start) × (t − start_bar) / (end_bar − start_bar). At the end bar the ray equals its retracement level exactly and keeps extending linearly. An up-leg fans upward, a down-leg mirrors automatically. Degenerate legs (equal prices, zero bar span) yield no rays. The optional price input feeds the above_N / below_N gates; without it the ray prices still flow.
Modes
Configuration
How many fan rays to draw, from 1 to 6. The default 3 is MT5's classic trio 38.2 / 50 / 61.8; higher counts add the 23.6 / 78.6 / 100 extensions. Only the first fan_count of the fan_N_pct percents are used.
Percent retracement anchoring ray #0: the ray passes through end + (start − end) × (pct / 100) at the leg's end bar (0 = the leg's end, 100 = its start). Default 38.2.
Percent retracement anchoring ray #1: the ray passes through end + (start − end) × (pct / 100) at the leg's end bar (0 = the leg's end, 100 = its start). Default 50.
Percent retracement anchoring ray #2: the ray passes through end + (start − end) × (pct / 100) at the leg's end bar (0 = the leg's end, 100 = its start). Default 61.8.
Percent retracement anchoring ray #3: the ray passes through end + (start − end) × (pct / 100) at the leg's end bar (0 = the leg's end, 100 = its start). Default 23.6.
Percent retracement anchoring ray #4: the ray passes through end + (start − end) × (pct / 100) at the leg's end bar (0 = the leg's end, 100 = its start). Default 78.6.
Percent retracement anchoring ray #5: the ray passes through end + (start − end) × (pct / 100) at the leg's end bar (0 = the leg's end, 100 = its start). Default 100.
Connects to
Examples
- Wire the Fibonacci Anchor's leg and cross close with the 61.8 ray (fan_price_2) to catch a fan-line break.
- Gate longs to bars riding above the 38.2 ray: wire close into price and use above_0.
Common mistakes
- Confusing this with TradingView's Speed Resistance Fan — that drawing divides the box at 0.25 / 0.5 / 0.75; this tool is MT5's fan through the 38.2 / 50 / 61.8 retracement levels.
- Forgetting rays start at the leg's START pivot: with pct 0 you get the leg's own trendline extended, not a flat level at the end price.