Voir comment télécharger gratuitement des robots de trading
Retrouvez-nous sur Facebook !
Rejoignez notre page de fans
Un script intéressant ?
Poster un lien vers celui-ci -
laisser les autres l'évaluer
Vous avez aimé le script ? Essayez-le dans le terminal MetaTrader 5
Indicateurs

Auto Fibonacci Retracement Swing Levels - indicateur pour MetaTrader 5

Cristhian Alexander Gaibor Cuasquer
Cristhian Alexander Gaibor Cuasquer
4.7 (40)
Trader et membre de MQL5 depuis 2017.
Vues:
440
Publié:
MQL5 Freelance Besoin d'un robot ou d'un indicateur basé sur ce code ? Commandez-le sur Freelance Aller sur Freelance

Fibonacci retracement on Gold (XAUUSD), forex and any symbol, drawn by the indicator on the last completed leg. It looks for confirmed swings, a high or a low with a set number of lower or higher bars on each side, and takes the two most recent ones as the leg.

When the low came first the leg is up and the levels are measured down from the high. When the high came first the leg is down and they are measured up from the low. You get 23.6, 38.2, 50, 61.8 and 78.6, the 61.8 in its own colour, and the price of each level next to the line. The 127.2 and 161.8 extensions are optional.

A swing needs closed bars on its right side before it counts, so the leg changes only when a new swing is confirmed. The levels are a map, not a signal, and the indicator does not trade.

Auto Fibonacci Retracement drawing the levels of the last completed swing leg with the 61.8 level highlighted on a MetaTrader 5 chart

Settings

Swings

  • Swing length (10): bars on each side of the swing candle. Lower values follow small legs, higher values keep only the big ones.
  • Bars to analyze from the right (600).
  • Use the last completed leg (true): off, it draws from the highest high to the lowest low of those bars.

Levels

  • Show 23.6, 38.2, 50.0, 61.8 and 78.6 (true).
  • Show the 127.2 extension and Show the 161.8 extension (false).

Display

  • Colour when the leg goes up, Colour when the leg goes down and Colour of the 61.8 level.
  • Line width (1), Line style (dot) and Extend the levels to the right (20 bars).
  • Show the price of each level (true), Font and Font size (8).

Alerts

  • Alert when price touches the 61.8 level (false), with Pop-up alert and Sound alert. It fires once per bar at most.

Indicator settings

  • Object prefix (XP_FIB_): change it to run two copies, for example swing 5 and swing 20 on the same chart.

What it needs

  • MetaTrader 5, any symbol and any timeframe.
  • It recalculates the leg once per new bar. The alert check runs on every tick.
  • Three hidden buffers for EAs: swing high (0), swing low (1) and direction (2, 1 up and -1 down), filled on the last bar. Read them with iCustom and CopyBuffer.

Make it yours

Put it on XAUUSD, EURUSD, GBPUSD, US30 and NAS100 from M15 to H4 and compare swing 5 against swing 20: the same chart gives two very different legs. The 61.8 and 78.6 zone is where many traders wait for a pullback entry, so it pairs well with support and resistance or with a Smart Money Concepts order block. In an EA, read the direction buffer and the swing high and low, then build your own entry on the retracement. For structure breaks, add my Smart Money Concepts BOS CHoCH.

About this code

Open source. Use it as it is, adapt it, build your own version on top of it.

New versions and new tools are announced first on my MQL5 channel: https://www.mql5.com/en/channels/xander

Questions, suggestions and your own backtests are welcome in the Xander Lab group: https://www.mql5.com/en/messages/02eec85e4364dd01

More tools on my profile: https://www.mql5.com/en/users/09151993a

Provided as is, use at your own risk.

Related

Changelog

  • v1.0 - 2026-10-25 - Initial release
Forex Session Boxes London New York Asia Forex Session Boxes London New York Asia

Forex session boxes for Gold (XAUUSD), forex and any symbol: draws the Asian, London and New York sessions with their high and low extended to the right and the range in points, in your broker server time. Open source code.

JAFX Advanced SMC (Smart Money Concepts) JAFX Advanced SMC (Smart Money Concepts)

An all-in-one Smart Money Concepts (SMC) indicator that automatically identifies Swing & Internal Market Structure (BOS/CHoCH), Order Blocks, Premium/Discount zones, and Equal Highs/Lows. It features a real-time multi-timeframe bias dashboard to help traders make informed decisions.

Moving Average Crossover EA Gold Moving Average Crossover EA Gold

Moving average crossover EA for Gold (XAUUSD), forex and any symbol: one position per cross of two moving averages on the closed bar, exit on the opposite cross, stop loss, take profit and breakeven in points. Open source code.

Risk and Stop-Loss Calculator Risk and Stop-Loss Calculator

When I first started scalping, I had a problem: during periods of high volatility, it sometimes took too long to calculate exactly 1%, and I’d end up setting an incorrect stop-loss or using a position size that was too low or too high. But with this calculator, I can do it much faster—I just have to drag a line to the stop-loss zone, and it automatically calculates the position size I should use for my 1%. I hope you find it very useful!