Watch how to download trading robots for free
Find us on Twitter!
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

Super Trend - indicator for MetaTrader 5

Hammad Dilber
Hammad Dilber
Professional MQL5 developer specializing in automated trading solutions. I create custom Expert Advisors, trading bots, and technical indicators for MetaTrader 5 platforms.
Services:
• Custom Expert Advisors (EA) from scratch
• Trading bot development with risk management
| English Русский 中文 Español Deutsch 日本語 Português 한국어 Français Italiano Türkçe
Views:
6972
Rating:
(6)
Published:
Supertrend.mq5 (7.57 KB) view
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

Supertrend Indicator: ATR-Based Trend Following for MetaTrader 5

The Supertrend indicator is a widely used trend-following tool built on the Average True Range (ATR). It plots a dynamic support or resistance line directly on the price chart, switching between a green uptrend line and a red downtrend line whenever the market changes direction. Traders use this signal to stay on the right side of the trend without having to interpret complex oscillators or multi-panel setups.

This implementation brings the full Supertrend logic into MetaTrader 5 as a native custom indicator. It supports two ATR calculation methods: the standard iATR function built into the MQL5 library, and a manual Simple Moving Average of True Range for traders who prefer a smoother band. Both methods produce the same trailing band structure, where the upper and lower bands tighten or widen with volatility and lock in once price moves decisively away from them.

When the trend flips from bearish to bullish, an upward arrow is drawn at the bar of the crossover. When it flips from bullish to bearish, a downward arrow appears. These buy and sell signals can be toggled on or off through the input settings, keeping the chart clean for traders who only need the trend line itself. The indicator is fully configurable through four input parameters: ATR period, ATR multiplier, calculation method, and signal visibility.


ss


Input Parameters

Parameter
Type
Default
Description
ATRPeriod
int
10
The lookback period used to calculate the Average True Range. A smaller value makes the bands more reactive to short-term volatility, while a larger value produces smoother, slower-moving bands.
ATRMultiplier
double
3.0
A multiplier applied to the ATR value to set the width of the upper and lower bands around the HL2 source price. Higher values create wider bands that produce fewer but more reliable signals, and lower values create tighter bands with more frequent trend flips.
ChangeATRMethod
bool
true
Selects the ATR calculation method. When set to true, the indicator uses the standard MQL5 iATR function. When set to false, it calculates a Simple Moving Average of True Range manually, which can produce slightly different band values on certain instruments.
ShowSignals
bool
true
Controls the visibility of buy and sell arrow signals on the chart. When set to true, a green upward arrow appears at bullish trend reversals and a red downward arrow appears at bearish trend reversals. Set to false to display only the trend lines without arrows.


Note: This indicator is intended for trend identification and educational purposes. Always validate signals on a demo account before applying them to live trading. Past performance of any indicator does not guarantee future results.

ASQ Order Executor ASQ Order Executor

ASQ Order Executor — Institutional order execution wrapper for MQL5 EAs ASQ Order Executor provides institutional-grade order execution with automatic retry logic, slippage monitoring, partial fill handling, requote management, and comprehensive execution statistics. Drop it into any EA for production-ready trade execution.

Advanced Trade History Exporter: MAE, MFE and Time-Based Excursions (Points) Advanced Trade History Exporter: MAE, MFE and Time-Based Excursions (Points)

Utility script that exports your MetaTrader 5 trading history to a CSV file. It automatically calculates Maximum Favorable Excursion (MFE), Maximum Adverse Excursion (MAE), and Forward Returns (Time-Based Excursions) in whole points for deep quantitative analysis in Excel. It will allow you to understand whether you close your trades too early and can help optimize overall trading execution.

Institutional Fourier Transform (DFT) Dominant Cycle  Language: MQL5 Institutional Fourier Transform (DFT) Dominant Cycle Language: MQL5

A digital signal processing (DSP) engine that applies the Discrete Fourier Transform (DFT) to market data, isolating the dominant cyclical frequency to project turning points and eliminate phase-lag.

Prime Quantum AI —  TRADE WITH AI (Anthropic Claude, OpenAI GPT, Google Gemini, DeepSeek, xAI Grok). Prime Quantum AI — TRADE WITH AI (Anthropic Claude, OpenAI GPT, Google Gemini, DeepSeek, xAI Grok).

Prime Quantum AI is an MT5 Expert Advisor combining a classical pre-filter (ADX + Alligator) with AI vision-based chart confirmation from major AI providers (Anthropic Claude, OpenAI GPT, Google Gemini, DeepSeek, xAI Grok). When the pre-filter detects a trend setup, the EA captures three adaptive- timeframe chart screenshots and sends them to the configured AI provider, which returns direction, confidence, stop-loss and take-profit. A trade is opened only when the AI confirms the pre-filter signal with sufficient confidence. Features: dual Standard Broker / Prop Firm risk modes, configurable lot sizing, optional martingale, multiple SL/TP modes, trailing stop, partial close, news/time/day/spread filters, draggable on-chart info panel, and fully exposed indicator parameters. Requires MetaTrader 5, WebRequest enabled for your provider's URL, and a valid API key. Provider auto-detected from key format.