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

Supertrend Gold Signals - indicator for MetaTrader 5

Cristhian Alexander Gaibor Cuasquer
Cristhian Alexander Gaibor Cuasquer
  • Founder & Systems Engineer at  Xander Pro
  • Ecuador
  • 8023
4.7 (40)
Trader and MQL5 member since 2017.
Views:
112
Rating:
(1)
Published:
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

The Supertrend line on Gold (XAUUSD) or any symbol is built from the candle midpoint, (high + low) / 2, plus or minus the ATR multiplied by a factor. Each band only moves in favour of the trend, and the trend flips when a candle closes on the other side of the active band. In an uptrend the line is green and sits below price, in a downtrend it is red and sits above price.

The arrow is drawn only after the flip candle has closed, never on the candle still forming, so an arrow you see on a closed bar stays there. Alerts follow the same rule: one alert for each closed candle with a flip, by popup, push notification or sound.

The line on the forming candle moves with price and can change side before the close. A Supertrend flip follows the trend, so it comes late in a range and gives back part of the move. Test the period and the multiplier on your symbol and timeframe before you trade it.

Supertrend Gold Signals with the green and red ATR line and buy and sell arrows on a XAUUSD M15 chart in MetaTrader 5

Settings

  • ATR period: bars used by the ATR. Default 10.
  • ATR multiplier: distance of the bands from the candle midpoint, in ATR multiples. Default 3.0.
  • Show arrows: on or off. Up arrow below the low of the flip candle for a buy, down arrow above the high for a sell.
  • Arrow distance: gap between the candle and the arrow, in ATR multiples. Default 0.5.
  • Popup alert (on by default), push notification and sound (both off by default), plus the sound file name. The message carries the symbol, the timeframe, the direction, the time of the closed candle and its close price.

What it needs

Any symbol, any timeframe. It draws two lines and two sets of arrows with standard indicator buffers and it never trades. Push notifications need your MetaQuotes ID set in the terminal options. Wrong inputs (ATR period below 1, multiplier of 0 or less) stop the indicator with a message in the log.

Make it yours

Run it on XAUUSD, XAGUSD, EURUSD, GBPUSD, US30 or NAS100 and compare M5, M15 and H1 with the same period and multiplier. A lower multiplier flips more often, a higher one stays longer in the trend. From an EA you can read it with iCustom: buffer 0 is the uptrend line, buffer 1 the downtrend line, buffer 2 the buy arrow and buffer 3 the sell arrow. The band and flip logic sits in one loop inside OnCalculate and the alert text in XP_Notify, both easy to lift into your own code. It is a good place to plug a session filter, a news filter, a higher timeframe trend check or support and resistance levels before you take the signal.

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-11-10 - Initial release
London Breakout EA: simple and transparent/London Breakout Expert Advisor: simple and transparent London Breakout EA: simple and transparent/London Breakout Expert Advisor: simple and transparent

Free breakout EA: Asian range, London breakout, one trade a day, stop loss always set, lot size based on risk percentage. No grid, no martingale. / Free EA: Asian range breakout during the London session, one trade a day, stop loss always set, lot size based on risk percentage. No grid or martingale.

ReliableOutbox: persistent message queue with Telegram demo ReliableOutbox: persistent message queue with Telegram demo

Persistent MQL5 outbox with a Telegram demo and offline tests. An uncertain result is never retried automatically. Manual retry may duplicate a message; SENT means API acceptance, not a read receipt.

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

MACD Signals MACD Signals

Indicator edition for new platform.