Watch how to download trading robots for free
Find us on Telegram!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Indicators

XANDER Adaptive Cross - indicator for MetaTrader 5

Views:
3791
Rating:
(6)
Published:
Updated:
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

Two moving averages that change speed with the market instead of using a fixed period. The fast line speeds up when price sits at the edge of its recent high to low range and slows down in the middle of it. The slow line follows the efficiency ratio, so it reacts in clean trends and stays flat in noise. Works the same on Gold (XAUUSD), forex pairs and indices.

Both lines share one color state: green and gold when the fast line is above the slow one, red and orchid when it is below. Every change of state prints an arrow on the bar where the cross happened, below the candle for a bullish cross and above it for a bearish one. Values are calculated on closed and live bars with the same formula, so what you see in history is what the indicator draws in real time.

It is a trend reading tool, not a complete strategy. Adaptive lines cut lag in trends but they still cross several times in a tight range, so combine the arrows with structure, a higher timeframe bias or your own filter before taking a trade.

Update v1.2 (October 2026): header and documentation rewritten, link to my MQL5 channel for updates, range cache reset on full recalculation so the lines redraw cleanly after a timeframe change. Calculation unchanged.

Settings

  • Adaptive Period: lookback for the range of the fast line and for the efficiency ratio of the slow line, default 14.
  • Applied Price: close by default, any standard price type works.
  • Fast Smoothing Period and Slow Smoothing Period: the fastest and slowest speed the lines can reach, 2 and 30 by default.
  • Efficiency Curve Power: how strongly the slow line reacts to the efficiency ratio, default 2.0. Higher values make it calmer in noise.

How to install

Download the .mq5 file, open MetaEditor (F4 in MetaTrader 5), place it in MQL5\Indicators and compile it with F7. Back in the terminal it appears in the Navigator under Indicators, drag it onto any chart. You can also open it from MetaEditor in the Code Base tab with one click. The indicator cleans the chart on load and restores your chart settings when you remove it.

Make it yours

Run it on XAUUSD, EURUSD, GBPUSD, US30 or NAS100 and compare M15, H1 and H4. The arrow buffers are plain data buffers, so an EA can read them with iCustom and CopyBuffer to trade the crosses. Natural extensions are a higher timeframe filter, an ADX threshold, Smart Money Concepts zones or support and resistance levels to keep only the crosses that matter, and alerts on new arrows.

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

Related: XANDER Pulse Candles, Basket Pair Closer, XANDER Grid XAUUSD.

Changelog

v1.2 (2026-10-25): documentation and header update, MQL5 channel link, range cache reset on full recalculation.
v1.1 (2026-04-19): distinct color palettes for the two lines.
v1.0 (2026-04-19): initial release.

Market Clock Pro Market Clock Pro

Candle countdown HUD with trading sessions (UTC), live spread and anomaly detection, daily range vs ADR, and market-closed state with reason (holiday / weekend / session). Holidays calendar included for seven major markets.

Institutional GARCH(1,1) Volatility Forecaster Institutional GARCH(1,1) Volatility Forecaster

A predictive quantitative engine that replaces lagging retail ATR, it utilizes the Nobel-prize-winning GARCH(1,1) econometric model to mathematically forecast future market volatility and variance.

Machine Learning Supertrend Machine Learning Supertrend

A machine-learning inspired approach towards trending regimes. Providing accurate signals and backtest confidence built-in

Easy Range Breakout EA - MT5 Easy Range Breakout EA - MT5

This EA implements a range breakout trading strategy. It calculates a price range between start and end times defined by the user, draws a visual rectangle on the chart to mark the high and low of that range, and then monitors price action after the range closes. If the market breaks above the range high, it opens a buy trade; if it breaks below the range low, it opens a sell trade.