This is a technical indicator used for identifying extrema of different degrees.
You can contribute to the source code on GitHub by opening new issues or making pull requests. You are also welcomed to comment below this post on mql5.com for reporting bugs, or suggesting any further improvement that you may find useful.
Run MetaTrader and navigate to your MetaTrader data folder through the menu bar by selecting File -> Open Data Folder. Copy Fractal-Utilities.mqh, Fractal-STF.mq4, and Fractal-MTF.mq4 into MQL4\Indicators folder. The final step is to compile Fractal-STF.mq4 and Fractal-MTF.mq4 via MetaEditor to create Fractal-STF.ex4 and Fractal-MTF.ex4, respectively. Now, you should be able to use the Fractal-MTF indicator within MetaTrader terminal. The only requirement for installation is to put all files into the same directory, which can be any subdirectory of MQL4\Indicators like MQL4\Indicators\Custom. Note that whenever you relocate the compiled files to another directory, you should recompile them in that directory to get them working.
There is a built-in fractal indicator in MT4/MT5, whose origins goes back to the famous Bill Williams. The main purpose of this indicator is to identify a local extremum by comparing a candle's high/low with that of its neighboring candles to justify it as an up-fractal/down-fractal, a term coined by Williams instead of local maximum/minimum. Some other equivalent terms are swing high/low and top/bottom, which are used among traders interchangeably.
This indicator has the following advantages over its built-in MT4/MT5 counterpart:
-
Williams believed that like our middle finger, which is a fractal compared with its two neighboring ones, the radius of the comparison should be chosen as two, which is the default value for the built-in fractal indicator in MT4/MT5. In this indicator, the user can choose this neighborhood radius to his/her will. This has the benefit of distinguishing extrema of different degrees at the same time on the chart as shown in Figure 1.
-
User can also choose the shape and size of symbols pointing to these extrema, enabling him/her to associate with extrema of each degree a unique symbol for better visualization.
-
User can specify the vertical distance of the arrows from the high/low of the candles to avoid overlapping of symbols corresponding to extrema of different degrees.
-
User can view higher timeframe fractals in a lower timeframe, making this a multi timeframe (MTF) indicator. For example, user can set the indicator timeframe as D1 and choose a radius of 2 for the fractals. Next, if user switches to M15 timeframe, Fractal-MTF marks those M15 bars whose high/low coincides with that of their corresponding fractals in D1 timeframe. Note that the indicator timeframe should be greater than or equal to the chart timeframe. If the user chooses an indicator timeframe smaller than the chart timeframe, indicator returns an error in the terminal and stops.

