OPEN-SOURCE SCRIPT
Aktualisiert

ZigZag MT5

1 313
ZigZag MT5 — 1:1 Port
A faithful port of the MetaTrader 5 standard ZigZag indicator to Pine Script v6. Same algorithm, same parameters, same output — just on TradingView.
Parameters (MT5 defaults):

Depth (12) — minimum bars between extrema; the lookback window for the Lowest/Highest scan
Deviation (5) — minimum price deviation in points (uses syminfo.mintick) before a new extremum is accepted
Backstep (3) — minimum bars between adjacent pivots; cleans up clustered extrema

How it works:
Mirrors MT5's two-buffer approach (ExtHighBuffer / ExtLowBuffer). For each bar it runs the Lowest/Highest scan, applies the deviation filter, removes weaker neighboring pivots within the backstep window, and finally alternates highs and lows in a second pass — including outside-bar handling.
Note: Like every ZigZag, the last segment repaints until a new opposing pivot is confirmed. By design.
Useful as a drop-in replacement if you're migrating strategies from MT5 to TradingView and need pivot points that match exactly.
Versionshinweise
- fine tune to match exact algo in mt5

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.