Attachments forums

Re: Gann Swing Chart for MT4

Cagliostro, Mon Jul 13, 2026 12:49 am

Gann Swing Legacy v1.0 — deterministic Gann Swing Charts for MT4


What it is
A boxed ("stair-step") Gann Swing Chart overlay for MT4, built the old way:
swings from highs and lows only, time and closing prices ignored, inside
bars skipped, outside bars held until the next bar decides them. Your price
bars stay visible; the red line draws the swing structure over them.

How faithful is this to Gann? The honest answer
Before writing a line of code we went to the primary sources: Gann's 1933
"Mechanical Method and Trend Indicator" and Master Courses, Robert Krausz's
1998 Stocks & Commodities article, and the Market Analyst/Optuma public
knowledge base for the modern lineage.

Straight from Gann's own texts:
  • An up bar needs a higher high AND a higher low — "the first day that the
    option records a higher bottom and a higher top". Krausz later dropped the
    higher-low qualifier in his New Gann Swing Chartist; we kept Gann's
    original requirement.
  • Construction uses highs and lows only — "not on closing prices".
  • Inside ("within") days do not move the trend line.
  • His main trend indicator counted 3 consecutive days — and in 1955 Gann
    annotated his own course by hand: "Use 2 day charts and rules better than
    3 day". Keep that in mind for the settings (Swing Count).

From the Market Analyst / Optuma school (documented in their public
knowledge base — NOT found in Gann's texts):
  • The formal four bar types (higher / lower / inside / outside), each bar
    measured against the immediately previous bar.
  • Outside bars resolved by the next decisive bar ("Use Next Bar"). Gann
    read the tape and knew which extreme came first; on OHLC data we cannot,
    so the school waits for the next bar to decide the order.
  • Consecutive outside bars: the last one becomes "the" outside bar (the
    old pre-clustering Market Analyst rule).
  • The "two moves in one bar" resolution that draws a counter-swing into
    the outside bar itself. We reconstructed this from the school's teaching:
    it is plausible and it charts beautifully, but we label it RECONSTRUCTED,
    not proven — and the indicator says so in its own log.

Our modern engineering (not historical at all):
  • Exact price comparisons on integer ticks, zero tolerance, no hidden
    noise filters. If you want fewer swings, raise the swing count — that is
    the Gann way to filter: structure, not thresholds.
  • Equal highs/lows are treated as strictly neutral (they neither turn nor
    extend a swing).
  • Signals only on closed bars. Confirmed pivots are frozen forever.

Does it repaint?
Confirmed pivots never move, never disappear, and a confirmed turn cannot
be un-confirmed — unlike the standard ZigZag, whose Depth/Deviation/
Backstep logic can relocate or delete a pivot retroactively. The only
living part is the current leg, which keeps extending until the opposite
bar closes. That is not repainting; that is the market not being finished
yet.

Under the hood
The engine was developed test-first against a Python reference model:
19 normative fixtures, buffer-level MT4/Python parity with zero mismatches
on BTCUSD M1 and GBPAUD D1, and deterministic rebuilds (same history in,
same pivots out, hash-verified). Eight documented buffers are exposed for
iCustom if you want to build EAs or studies on top of it.

Credits
Firesword for the request and the memory of the original; W.D. Gann's
Mechanical Method (1933, annotated 1955); Robert Krausz (Stocks &
Commodities, Feb 1998); the Optuma public knowledge base for the modern
documentation of this indicator family.

+C+ <3
All files in topic