Auto Fibonacci Retracement for MT4/MT5

Auto Fibonacci Retracement for MT4/MT5
Download ALL MT5 indicators (6081)
YouTube Video Thumbnail



Similar MetaTrader Tools

Auto Fibonacci Retracement for MT4/MT5

Info

The Auto Fibonacci Retracement for MT4/MT5 is a Indicator for MetaTrader 5 that auto fibonacci retracement on the latest swingthe idea behind itfibonacci retracements are widely used technical analysis tools. After a price swing, the market often pulls back by a certain fraction of that swing (23.

Usage

This tool is typically used for enhancing chart analysis and decision making.

Platform

This Indicator works exclusively on MetaTrader 5 (both build 600+ and newer versions).

Setup

Place the downloaded file in MQL5/Indicators folder via File ? Open Data Folder in MetaTrader 5.


How to Install and Use Auto Fibonacci Retracement for MT4/MT5

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

Auto Fibonacci Retracement on the Latest SwingThe Idea Behind ItFibonacci retracements are widely used technical analysis tools.

Typical Use Case

This Indicator excels in automated trading and technical analysis on MetaTrader 5.

Compatible Platform & Setup

This Indicator works on MetaTrader 5. Place the file in the MQL5/Indicators folder and restart the terminal.

Description & Settings

Related: Ezo Smart Fibo: Intuitive Two-Click Fibonacci Tool with Candle Snap - another powerful indicator for MetaTrader 5 traders.

Auto Fibonacci Retracement on the Latest Swing

Also recommended: Ezo Session Boxes: Asian, London, and New York Session High-Low Boxes with Auto GMT Offset - similar indicator with strong performance on MetaTrader 5.


The Idea Behind It

Fibonacci retracements are widely used technical analysis tools. After a price swing, the market often pulls back by a certain fraction of that swing (23.6%, 38.2%, 50%, 61.8%, 78.6%) before the move continues. Drawing them manually is slow and subjective because the trader must select the two anchor points of the swing each time.

This indicator automates this process in three steps:

Swing Points.
A bar is considered a swing high if its high is the highest among the bars within the InpSwingLeft range to the left and the InpSwingRight range to the right. A swing low is defined similarly using the lows.

Latest Leg.
Swing points are identified alternately (high, low, high, etc.). The last two points define the latest swing leg. If two swing points of the same type occur consecutively, the more extreme point is retained.

Levels.
Fibonacci levels are drawn based on the identified leg. The 0% level is at the end of the leg (the most recent swing point), and the 100% level is at its start. A 38.2% level, for instance, represents the price that has retraced 38.2% of the leg back towards its starting point. Prices above 100% or below 0% are also possible.

A swing point is confirmed only after InpSwingRight bars have closed following it, ensuring that the leg is constructed from completed, non-repainting swing points.

How to Interpret It

Dots
– Optional markers indicating detected swing points: above the bar for swing highs, below the bar for swing lows.

Dotted Line
– Represents the latest swing leg, connecting its two swing points.

Horizontal Lines
– Display the Fibonacci levels. The 0% and 100% levels are solid lines, while the inner levels are dashed. These lines originate at the beginning of the leg and can extend to the right.

Labels
– Optional text next to each line, showing the level percentage and its corresponding price.

Direction
– After an up leg (ending in a swing high), the levels appear below the high, indicating potential support for a pullback. After a down leg (ending in a swing low), the levels are above the low, indicating potential resistance.

Info Label
(upper-left corner) – Provides the direction of the latest swing, its start and end prices, and the current retracement percentage of the last price. Values over 100% suggest the price has moved beyond the leg's start, while negative values indicate movement beyond the leg's end.

A New Swing
– When a new opposite swing point is confirmed, the previous leg is replaced, and all associated lines and labels update to reflect the new leg.

Fig. 1. Auto Fibonacci Retracement on an H1 chart: illustrates the latest up leg with its levels and labels, and swing points marked by dots. The image is black and white as per Code Base guidelines; colors are customizable.

External Variables (Inputs)

Input

Default

Purpose

InpSwingLeft

5

Number of bars to the left of a potential swing point that must have a lower high (or higher low). Must be 1 or more.

InpSwingRight

5

Number of bars to the right that must have a lower high (or higher low). This also determines the confirmation delay for a swing point. Must be 1 or more.

InpMinLegPoints

0

Minimum size of a swing leg in points. Legs smaller than this value are ignored. A value of 0 disables this filter.

InpHistoryBars

3000

The number of recent bars to search for swings when the indicator is initially loaded. Must be 100 or more.

InpLevels

0,23.6,38.2,50,61.8,78.6,100

A comma-separated list of Fibonacci levels in percentage. Supports 1 to 12 values. Values like -27.2 or 161.8 will draw levels beyond the standard leg range.

InpExtendRight

true

Determines whether to extend the level lines to the right edge of the chart and place labels near the last bar.

InpShowLabels

true

Controls the display of labels showing the Fibonacci level and its price for each line.

InpLevelColor

clrGoldenrod

Specifies the color for the Fibonacci level lines and their associated labels.

InpLegColor

clrGray

Sets the color for the line connecting the two swing points that form the leg.

InpShowPivots

true

Enables or disables the display of dots marking the identified swing highs and lows.

InpShowInfoLabel

true

Determines whether to show the informational label displaying the swing details and current retracement.

InpLabelColor

clrSilver

Sets the color for the informational label.

Note: The colors for the swing dots can be adjusted in the indicator's properties under the

You may also like: WATL for MT5: Automated Trend Analysis Indicator - excellent alternative for indicator users on MetaTrader 5.

Source Code

#property copyright "RobotFX"
#property link "https://robotfx.org"
#property version     "1.00"
#property description "This code is educational. Feel free to use, modify and upgrade as you wish. Visit ROBOTFX.ORG for professional trading tools"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_plots   2
#property indicator_label1  "Swing High"
#property indicator_type1   DRAW_ARROW
#property indicator_color1  clrTomato

.......

Leave your opinion, ask a question, share some knowledge

⚠ 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.
© ROBOTFX Free educational tools by RobotFX. Use entirely at your own risk; we are not liable for any financial losses incurred.