Gann Trendline
- Indicateurs
-
Marian Beceanu
Atlas Enterprise Matrix:
https://www.mql5.com/en/market/product/183575
ZigZag Maturity — Multi-Timeframe Swing Maturity & Reversal Probability Dashboard - Version: 7.10
- Activations: 10
This is a multi-timeframe Gann-angle trendline indicator for MT5. It automatically finds the swing high and swing low in a lookback window, draws a descending line from the high and an ascending line from the low at a calibrated angle (45° by default, auto-scaled to the symbol's real price range so 45°/45° are true mirror images), projects optional parallel channel lines above/below each, and can pull all of this from a different timeframe than the chart it's displayed on (e.g. show H4 structure while trading on M15). It also fires popup/push/email alerts when price touches any of the drawn lines.
Inputs, explained
Multi-Timeframe
- SourceTimeframe — which timeframe's bars are used to find the swing high/low and calibrate the slope. PERIOD_CURRENT = same as the chart (classic single-TF behavior). Set it to e.g. H4 to see higher-timeframe Gann structure overlaid on a lower-timeframe chart.
Lookback & Slope
- CandlesOnChartH / CandlesOnChartL — how many bars (on the source timeframe) to scan for the swing high (anchors DownLine) and swing low (anchors UpLine).
- AutoScaleSlope — if true (recommended), the angle is calibrated from the actual price range ÷ bar count of the lookback window, so it stays consistent across symbols/timeframes/zoom. If false, you set a manual slope in broker points/bar instead.
- DownLineAngleDeg / UpLineAngleDeg — the angle in degrees when AutoScaleSlope=true .
- DownLineSlopePoints / UpLineSlopePoints — manual slope (points per bar) when AutoScaleSlope=false .
Main Line Appearance
- Style_DownLine / Style_UpLine , Width_DownLine / Width_UpLine , Color_DownLine / Color_UpLine — pure cosmetics for the two main lines.
Ray Extension
- ExtendBackward — extend the main lines into the past (legacy anchor mode).
- ExtendForward — project the main lines into the future.
- ForwardBars — how many bars ahead to project when ExtendForward=true .
Parallel Start Point
- ParallelsFromNow — if true, parallel channel lines start at today's price (fan out only into the future, never crossing old history). If false, they start at the same historical anchor as the main line.
- ParallelsIntoPast — also project parallels backward across history, independent of the two settings above.
DownLine Parallels / UpLine Parallels (mirrored for each line)
- ParallelCount_Down/Up — how many parallel lines per side.
- ParallelOffsetPoints_Down/Up — spacing between each parallel, in points.
- ParallelBothSides_Down/Up — draw parallels on both sides of the main line, or just one.
- ParallelBelow_Down / ParallelAbove_Up — which single side, when BothSides=false .
- Color/Style/Width — cosmetics.
Recalculation
- RecalcOnEveryTick — recompute intrabar (more reactive to fast price moves, more CPU) vs. only on bar close.
- RecalcThrottleMs — minimum milliseconds between intrabar recalcs, to cap CPU use when RecalcOnEveryTick=true .
Alerts
- EnableAlerts — master switch.
- AlertPopup / AlertPush / AlertEmail — which channel(s) fire.
- AlertOnParallels — alert on parallel lines too, not just the 2 main lines.
- AlertProximityPoints — how close (in points) price must get to a line to count as a "touch".
- AlertCooldownSec — minimum gap between repeat alerts on the same line, so it doesn't spam you while price hovers near it.
Multi-Instance Safety
- InstanceTag — unique tag so you can run two copies of the indicator on one chart (e.g. one at 30°, one at 60°) without their objects overwriting each other.
How it helps in real trading
- Objective, repeatable structure instead of hand-drawn trendlines — the swing anchors and angle are recalculated the same way every time, removing the subjectivity of manual Gann-line drawing.
- MTF context without switching charts — you can trade on M15 while seeing where the H4 (or D1) trendline and its parallel channel currently sit, which is exactly how most discretionary traders actually use higher-timeframe trendlines: as a bias filter for lower-timeframe entries.
- The parallel channel gives you a range, not just a line — price action inside the fan (between offset levels) reads as "still trending within its channel"; a clean break of the outer parallel is a stronger signal than a single-line break.
- Auto-scaled 45° is a genuine Gann reference angle, comparable across symbols and timeframes, rather than a screen-pixel angle that looks different on every monitor/zoom.
- Alerts close the loop so you don't have to sit watching the chart waiting for a touch — useful for higher-timeframe lines that may take hours or days to be tested.
A few trading strategies to build on it
- HTF bias, LTF trigger. Set SourceTimeframe=H4 (or D1) on an M15/H1 chart. Only take longs when price is above the H4 UpLine, only shorts when below the H4 DownLine. Use the lower timeframe's own price action (candlestick rejection, break of a minor structure) as the actual entry trigger.
- Channel breakout. Use ParallelCount_Down/Up with 2–3 parallels each side and ParallelsFromNow=true . Treat a close beyond the outermost parallel (not just the main line) as a momentum breakout signal — it filters out the many touches of the main line that don't lead anywhere.
- Mean-reversion inside the fan. In a ranging market, fade touches of the outer parallels back toward the main line, with a stop just beyond that parallel. Works best when AutoScaleSlope angle is set relatively flat (e.g. 15–25°) so the channel isn't too steep to be realistic.
- Confluence trendline break + retest. Wait for a close through the main DownLine/UpLine, then wait for price to retest the broken line from the other side before entering — the line itself acts as a dynamic support/resistance flip. Use AlertOnParallels=false , AlertProximityPoints set to a few times the spread, so the alert tells you exactly when the retest is happening.
- Multi-instance angle comparison. Run two copies via InstanceTag — one at 30°, one at 63.75° (classic Gann angles) — to see which angle the market is actually respecting right now, and only trade in the direction both agree on.
