◆ New — Strategy Validator, Code Fixer & Prop Compliance Checker are live. Try one free →
Home / Indicators / Gann Fan
Trend indicator

Gann Fan

A fan of straight lines projected from a pivot at fixed price-per-time slopes — deterministic geometry whose meaning depends entirely on a scale you must choose.

Illustrative diagram — not live market data.

What it is

A Gann fan is a set of straight rays drawn from a significant high or low at a family of fixed slopes, conventionally labelled 1x1, 2x1, 1x2 and so on, associated with the early-20th-century trader W.D. Gann. The 1x1 line is described as a '45-degree angle' rising one unit of price per one unit of time; the 2x1 rises twice as fast, the 1x2 half as fast. Here is the correctness point most explanations skip: price and time are different dimensions, so an 'angle' between them is meaningless until you fix how much price one bar represents. A 45-degree line is not a property of the market — it is a property of your chart scale. Resize the chart or change the zoom, and the same visual fan crosses price at different places, which is exactly why traders ask why their Gann fan 'changes when I resize my chart.' It does, unless the tool locks an explicit price-per-bar ratio. The fan is a drawing tool that describes trend rate; it predicts nothing. This is educational content only, not financial advice, and trading involves risk of loss.

How it works

Strip away the mysticism and each fan line is elementary linear projection: choose an anchor pivot (price P at bar B) and a unit u meaning 'price change per bar,' and every line is just y = P ± ratio × u × (bars since B). The 1x1 uses ratio 1, the 2x1 uses ratio 2, the 1x4 uses ratio 0.25, and so on — nothing adaptive, statistical, or hidden. The genuinely contested part is the unit u. Gann worked on specific commodities where 'one point per day' had conventional meaning; on a modern chart there is no natural unit — one pip per bar on EURUSD and one dollar per bar on a stock index are arbitrary choices. Implementations resolve this in one of two ways: they let you set the unit explicitly (reproducible, and what our Pine example does), or they derive it from the current screen geometry (which silently makes every 'signal' depend on your zoom level). Two traders with different window sizes and an auto-scaled fan are not looking at the same lines, even from the same anchor.

How traders read it

Common settings

There is no standard configuration. The anchor is typically a major swing high or low; the conventional ratio set runs 1x8, 1x4, 1x3, 1x2, 1x1, 2x1, 3x1, 4x1, 8x1; and the unit (price per bar) must be chosen explicitly per instrument and timeframe — it is the single most consequential setting and the one most tools hide. Platform drawing tools often offer a 'lock price-to-bar ratio' option; without it, the fan's geometry follows your zoom level.

Strengths

Pitfalls to watch

Pine v6 example

//@version=6
indicator("Gann Fan (Explicit Scale)", overlay = true, max_lines_count = 12)

anchorTime = input.time(timestamp("2025-01-01T00:00:00"), "Anchor Bar", confirm = true)
unit       = input.float(1.0, "Price Units Per Bar (defines the 1x1)", step = 0.01)
fanUp      = input.bool(true, "Fan Upward")
span       = input.int(200, "Bars To Project", minval = 10)

// Draw once at the anchor bar. Slopes come from the explicit unit,
// so the fan is reproducible and independent of chart zoom.
if time == anchorTime
    base = fanUp ? low : high
    dir  = fanUp ? 1 : -1
    ratios = array.from(0.25, 0.5, 1.0, 2.0, 4.0) // 1x4, 1x2, 1x1, 2x1, 4x1
    for i = 0 to array.size(ratios) - 1
        r = array.get(ratios, i)
        line.new(bar_index, base, bar_index + span, base + dir * r * unit * span, extend = extend.right, color = color.new(color.blue, 20))

Pro tip: If you use a platform's built-in Gann fan drawing, find and enable its price-to-bar ratio lock before drawing anything — otherwise your fan is a function of your window size. Better still, define the unit explicitly in code (as above) so every line is a stated, checkable assumption rather than an accident of zoom. This is educational information only, not financial advice; fan lines describe a chosen slope, predict nothing, and all trading carries risk of loss.

Built an indicator from this? Run it through the Validator to catch look-ahead bias and repainting, or convert a strategy to Pine Script.

Educational only — not financial advice, not a recommendation to trade. No indicator is predictive; trading involves substantial risk of loss.

Catch the bug that compiles.Run auditGet Pro