Skip to content
FXNook HubBeta

Alex / ZigZag Fibonacci Retracement Indicator for MT4

MetaTrader 4IndicatorMITCompiled · build 2425
Compile logCompiled
MetaEditor build 2425 · MT4 · 1 Dec 2026, 10:23 UTCcompiling FXN_ZigZagFibonacci.mq4✓ Result: 0 errors, 0 warnings, 3.8 soutput FXN_ZigZagFibonacci.ex4 · 21 KBsha256 72fb73170ff13753…6e3d554c

Files version 1.0

FileLinesSize
FXN_ZigZagFibonacci.mq430511 KB
FXN_ZigZagFibonacci.ex4 compiled by the Lab–21 KB
FXN_ZigZagFibonacci.mq4305 lines
//+------------------------------------------------------------------+//| FXN_ZigZagFibonacci.mq4                                          |//| FXNook Lab Hub starter library - MIT licence                     |//| https://lab.fxnook.com/hub                                       |//+------------------------------------------------------------------+#property copyright "FXNook Lab (MIT licence)"#property link      "https://lab.fxnook.com/hub"#property version   "1.00"#property description "ZigZag swings (depth or percent) with Fibonacci retracement levels on the last completed swing. The last leg can change."#property strict#property indicator_chart_window#property indicator_buffers 1#property indicator_color1  clrDodgerBlueenum ENUM_ZZ_MODE{   ZZ_MODE_DEPTH   = 0, // Depth / deviation / backstep   ZZ_MODE_PERCENT = 1  // Percent reversal};//--- inputssinput string      InpSep1        = "=== ZigZag ===";    // ---- ZigZag ----input ENUM_ZZ_MODE InpMode        = ZZ_MODE_DEPTH;   // How a swing reversal is detectedinput int          InpDepth       = 12;              // Depth: reversal bar must make a new low/high of this many barsinput int          InpDeviation   = 50;              // Deviation: minimum reversal size in points (depth mode)input int          InpBackstep    = 3;               // Backstep: minimum bars between two swing points (depth mode)input double       InpPercent     = 1.0;             // Reversal size in percent of price (percent mode)input color        InpZigZagColor = clrDodgerBlue;   // ZigZag line colourinput int          InpZigZagWidth = 2;               // ZigZag line width (1-5)sinput string      InpSep2        = "=== Fibonacci ==="; // ---- Fibonacci ----input bool         InpShowFib     = true;            // Draw Fibonacci levels on the last completed swinginput string       InpFibLevels   = "0,23.6,38.2,50,61.8,78.6,100"; // Levels in percent, comma separatedinput color        InpFibColor    = clrGoldenrod;    // Colour of the Fibonacci lines and labelsinput bool         InpExtendRight = true;            // Extend the levels to the right edge of the chartinput bool         InpShowLabels  = true;            // Show level and price labels//--- buffersdouble ZzBuf[];
Sign in to read all the code and download it

It is free. A free account lets you see every line, copy it, download the source and open a copy in your Lab. The compiled file can be downloaded without an account.

Sign in Create a free account

Version history

  1. Version 1.0Live1 Dec 2026

    First version.

    Source · Compiled