fractal
Info
The fractal is a Indicator for MetaTrader 4 that support and contribution if you find this indicator useful, you can show your support by giving a star to its and this post. you are more than welcome to comment below this post for reporting bugs, or suggesting any further improvements that you may find useful.
Usage
This tool is typically used for enhancing chart analysis and decision making.
Platform
This Indicator works exclusively on MetaTrader 4 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL4/Indicators folder via File ? Open Data Folder in MetaTrader 4.
How to Install and Use fractal
1. Installation: Place your file in the MQL/Indicators folder via "Open Data Folder" and restart your terminal.
2. Loading: Find the indicator in the Navigator, drag it onto your chart, and configure the input parameters in the popup window.
3. Customization: Press Ctrl+I to open the indicator list, select your tool, and click "Properties" to change colors, levels, or visual styles.
4. Updating: Replace the old file in the Indicators folder with the new version and restart the platform to apply changes.
Frequently Asked Questions
Q: Why is my indicator not showing? A: Verify the file is in the MQL/Indicators folder, or try right-clicking the "Indicators" tree in the Navigator and clicking "Refresh."
Q: Do custom indicators slow down the platform? A: Too many complex indicators can impact performance; remove unused ones via the "Indicator List" (Ctrl+I).
Q: Can I use MT4 indicators on MT5? A: No, MQL4 and MQL5 are distinct languages; ensure the indicator is compiled specifically for your platform version.
What this tool does
support and contribution if you find this indicator useful, you can show your support by giving a star to its and this post.
Typical Use Case
This Indicator excels in automated trading and technical analysis on MetaTrader 4.
Compatible Platform & Setup
This Indicator works on MetaTrader 4. Place the file in the MQL4/Indicators folder and restart the terminal.
Description & Settings
Related: wlx fractals indicator - another powerful indicator for MetaTrader 4 traders.
support and contributionif you find this indicator useful, you can show your support by giving a star to its and this post. you are more than welcome to comment below this post for reporting bugs, or suggesting any further improvements that you may find useful. you can do the same by opening an issue on the github repository. you can also contribute to the source code by making a pull request on the github repository.
Also recommended: advanced fractals indicator - similar indicator with strong performance on MetaTrader 4.
installationrun metatrader and navigate to your metatrader data folder through the menu bar by selecting file -> open data folder . copy fractal-utilities.mqh into mql4\include folder, and copy 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-stf and fractal-mtf indicators within metatrader terminal. the only requirement for installation is to put both fractal-stf.mq4 and fractal-mtf.mq4 into the same directory, which can be any subdirectory of mql4\indicators like mql4\indicators\developed . note that whenever you relocate the compiled files to another directory, you should recompile them in that directory to get them working.
description
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:
1. 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
.
2. user can also choose the shape of symbols pointing to these extrema, enabling him/her to associate with extrema of each degree a unique symbol for better visualization.
3. 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. the idea for dynamic adjustment of the vertical distance was mainly inspired by the answers of tdbarnard in . the main point to consider is that we want the
pixel distance
of an arrow (arrow offset) to be a constant value away from a candle's high/low. however, this does not mean that the equivalent
price distance
should be constant too. indeed, as the chart's scale is changed, the price distance corresponding to a fixed pixel distance will also change, which requires a dynamic distance adjustment. you can see the detailed implementation of this idea in the code.
4. user can view higher time frame fractals in a lower time frame, making this a multi time frame (mtf) indicator. for example, user can set the indicator time frame as d1 and choose a radius of 2 for the fractals. next, if user switches to m15 time frame, fractal-mtf marks those m15 bars whose high/low coincides with that of their corresponding fractals in d1 time frame. note that the indicator time frame should be greater than or equal to the chart time frame, which is attached to it. if the user chooses an indicator time frame smaller than the chart time frame, then the indicator uses the chart time frame by default.
figure 1
. fractals with neighborhood radius of 2 and 5.
figure 2.
inputs of the fractal-mtf indicator.
You may also like: fractal dimension indicator - excellent alternative for indicator users on MetaTrader 4.
Source Code
#include <fractal-utilities.mqh>
#property copyright "robotfx"
#property link "https://robotfx.org"
#property version "1.3"
#property description "this code is educational. feel free to use, modify and upgrade as you wish. visit robotfx.org for professional trading tools"
#property description "this code is educational. feel free to use, modify and upgrade as you wish. visit robotfx.org for professional trading tools"
#property description "this code is educational. feel free to use, modify and upgrade as you wish. visit robotfx.org for professional trading tools"
#property strict
#property indicator_chart_window
#property indicator_buffers 4
.......
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.