Watch how to download trading robots for free
Find us on Facebook!
Join our fan page
Access the CodeBase from your MetaTrader 5 terminal
Couldn't find the right code? Order it in the Freelance section
How to Write an Expert Advisor or an Indicator

Top MQL4 and MQL5 source codes based on user ratings - 13

Submit your code

Keltner Channel (MetaTrader indicator) — is a classical technical analysis indicator developed by Chester W. Keltner in 1960. The indicator is somewhat similar to the Bollinger Bands and Envelopes. It uses three plot lines: the middle line is the 10-day simple moving average applied to the typical price ((high + low + close) / 3), the upper and the lower bands are produced by adding and subtracting the moving average of the daily price range (High and Low difference) from the middle line. This way, a volatility-based channel is built. In this version of the indicator you can modify all the parameters of the MA. The indicator is available both for MT4 and MT5 versions of the platform.

QQE MetaTrader indicator — or Quantitative Qualitative Estimation, is based on a rather complex calculation of the smoothed RSI indicators. As a result, you get two lines in a separate indicator window — the fast one and the slow one. There is also an important indicator level (50), which is used in signals. You can enable text, sound, and e-mail alerts for this indicator. This QQE implementation supports multi-timeframe analysis with upper timeframe display. The indicator is available for MT4, MT5

Range Expansion Index (MetaTrader indicator) — is a relative oscillator indicator that measures the pace of the price changes and signals overbought/oversold states if the price demonstrates weakness or strength. It was developed by Tom DeMark and explained in his book The New Science of Technical Analysis. The value of the indicator changes from -100 to +100. The REI is an enhanced oscillator because it tries to remain calm during the range trading and indicates signals only when the significant peaks or bottoms are spotted. You can download this indicator both for MT4 and MT5.

RSIOMA MetaTrader indicator — this indicator takes two moving averages, calculates their RSI (Relative Strength Index) and then also adds a moving average of the calculated RSI. These two lines now can accurately signal the trend changes. They are shown in the separate window where they change from 0 to 100. The auxiliary histogram is shown for a quick-glance view of the current trend. The indicator is available for both MT4 and MT5 versions of the MetaTrader platform.

TD Sequential Ultimate MetaTrader indicator shows all parts of the TD Sequential method developed by the legendary technical analyst, Tom DeMark. TD Sequential Ultimate displays Buy and Sell Setups, including the Setup Perfection arrows, Buy and Sell Countdowns, including the failed count 13 attempts, and TDST Support and Resistance levels. Unlike many other implementations of the TD Sequential method, this indicator offers multiple improvements:

Trend Equilibrium Indicator TrendEQ dynamically analyses market trends by combining momentum and volatility. By measuring momentum against market trends, TrendEQ provides a reliable measure of trend strength and direction.

An indicator which visualizes how volume changes over time within each bar. It shows tick volume in a rolling histogram format.

Download all the ticks from your broker for all the symbols in the market watch. Download all history or until a specific date in the past if available.

The goal is to make the function readily available for any Telegram integration task in MQL5 development. By adding this file to your CodeBase, you can simply include it in your Expert Advisors and call the function directly from the included module. This eliminates the need to redevelop the code from scratch repeatedly, ensuring reusability across multiple projects.

This is a piece of code to add to an existing Expert advisor to track withdrawals from your account where the EA is running. It helps the user to monitor his or her withdrawals from a particular account.

EquiPeak Drawdown Tracker is an indicator designed to monitor and record the maximum drawdown of your trading account in real time. It's not just a current drawdown indicator; it's especially useful for visually comparing your current drawdown with the maximum historical drawdown you expect or have previously recorded.

The Custom MA Cross with RSI Indicator for MT5 is a versatile trading tool designed to help traders identify trend changes and filter entries using momentum. This indicator combines two moving averages (MA) with the Relative Strength Index (RSI), offering clear buy and sell signals.

Script for partially close active buy orders

Partially close active sell orders

try to imitate trading system using expert advisor

"2 Moving Averages with Bollinger Bands" is a custom MT5 indicator that combines two configurable moving averages and optional Bollinger Bands. It generates real-time Buy and Sell arrows when crossovers occur, with optional alerts, sound, and email notifications. Suitable for all timeframes and symbols

MQL5 script for MetaTrader 5 that adds two buttons to close all buy or sell positions for the current symbol.

Name of expert is 'MultiStrategyEA'

The Value Area Retracement indicator, is a powerful volume profile-based tool designed to identify key trading levels—Point of Control (POC), Value Area High (VAH), Value Area Low (VAL), and Profile High/Low—across different timeframes. It helps traders spot potential retracement opportunities to the POC, breakout zones, and value areas, making it useful for intraday, swing, and position trading.

Tarantella EA: Advanced grid trading system with hedging capabilities and Market Profile integration. Uses ADX trend filtering, Fibonacci-based grid spacing, and multi-layered entry conditions (RSI/ATR/volume) to execute trades only within Market Profile value areas. Features intelligent risk management including trailing stops, breakeven triggers, and partial hedge closing.

Provide simplest class to write CSV file

The WaveTrend Indicator (WT) is a powerful technical analysis tool designed to identify trend direction and potential reversal points. It plots two lines, WT1 and WT2 , in a separate window, calculated based on price momentum and smoothed averages.

A simple yet effective RSI indicator that monitors overbought and oversold conditions on any symbol and timeframe. Sends instant alerts via pop-up and mobile notifications when RSI crosses your defined thresholds.

CandleMove - Pips & Percentage Movement Display A visual tool that helps you quickly gauge the strength of each candle by displaying its price change directly on the chart.

Hover over any candle to see what MT5 doesn't show: Range size, Body percentage, Wick ratios. Smart, fast, and customizable.

Function of lot calculation by risk percentage

This script serves as a practical example of how developers can programmatically work with files using MQL5. One of its key objectives is to demonstrate effective project file organization, which is essential for developers working on large-scale systems or aiming to create portable, self-contained projects. The concept can be expanded further and refined with additional ideas to support more advanced development workflows.

Filter trades by trading sessions (London, NY, Tokyo, Sydney)

This library provides real-time spread monitoring and statistical diagnostics for MetaTrader 5 symbols. It tracks spread evolution using a lightweight circular buffer and computes running metrics such as average, minimum, maximum, and standard deviation. The library classifies current spread conditions into informational states (low, normal, high, extreme) and offers helper methods to query spread behavior and stability. Optional notifications can be enabled to signal unfavorable market conditions. The library is purely analytical: it does not place trades, manage orders, or modify account state, and is intended to be used as a supporting tool inside Expert Advisors or indicators.

monitoring varous trends of timeframes in one timeframes

Include class that validates combined terminal ping + execution latency before trade operations. Returns false if threshold is exceeded.

ExMachina CandleTimer Lite - Free candle countdown timer for MetaTrader 5 with the ExMachina steel palette theme.

Heikin Ashi overlay (color candles or line) with 5 smoothing methods, step filter, MTF, signal arrows, strength meter, dashboard, and 4-channel alerts (popup/sound/push/email). Free.

ATR-based trend indicator with 3 ATR modes (Wilder/SMA/EMA), dynamic color line, signal arrows, trend duration, distance in pips, trend strength rating, signal counter, expanded dashboard, 4-channel alerts. Free.

An institutional time and price filter that highlights strict macroeconomic trading windows and automatically projects Fair Value Gaps exclusively when institutional volume is present.

A free, open-source breakout scalping Expert Advisor for MetaTrader 5 by AlgoSphere Quant. It implements a strict seven-condition entry system where every condition must align simultaneously before any trade is taken.

Real-time spread monitor with statistics panel, CSV logging & alerts

ASQ Divergence Detector scans your chart for regular and hidden RSI divergences and marks them with color-coded, non-repaint arrows.

A high-frequency trading utility designed to measure real-time tick velocity and detect toxic order flow spikes before they reflect entirely on standard price candles.

A dynamic Smart Money utility that identifies institutional Order Blocks backed by volume anomalies and automatically tracks their mitigation state to keep your charts clean and focused on fresh liquidity.

1...67891011121314151617181920...200