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

Submit your code

EA Tools tính toán Margin theo lotsize, có thể tùy chỉnh đòn bẩy

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

This is an experimental Last Structure Break (LSB) price action indicator that uncovers meaningful market structures and potential trading edges through intelligent support and resistance analysis.

Function for lot calculation from deposit percentage

Line to change direction

Keltner style reversal EA for Gold (XAUUSD) with dual EMA filter and optional recovery basket. Basket take profit and hard stop in money, session and spread filters, trailing stop. Updated October 2026 (v1.2). Open source code.

Diagnostic script that compares SYMBOL_TRADE_TICK_VALUE, SYMBOL_TRADE_TICK_VALUE_LOSS and SYMBOL_TRADE_TICK_VALUE_PROFIT for every symbol in Market Watch. Classifies each symbol into one of four categories (ALL_EQUAL, TV_MATCHES_PROFIT, TV_MATCHES_LOSS, ALL_DIFFER) and provides an aggregated summary plus interpretation tip. Useful for verifying which tick-value property to rely on when implementing risk-based lot sizing in EAs. Exports full per-symbol report to CSV in MQL5/Files.

Shows average price range per hour of the trading day as an on-chart heatmap, plus Asian/London/New York session shading behind the candles — so you can see when a symbol actually moves, not just guess.

Extreme Value Theory (EVT) ported into MQL5 for gauging potential crashes and upsets in the market.

A free, read-only MetaTrader 5 panel that converts your prop firm's daily reset rule (written in whatever time zone the firm uses) into your broker's actual server time, shows a live countdown to the next reset, and warns you before a daylight-saving shift moves the boundary by an hour. Sends no orders, reads no account data, display only.

Adaptive MACD is a dynamic momentum indicator that adjusts its smoothing based on market conditions. It calculates a Pearson correlation coefficient between price and bar index over a user-defined period, then uses the resulting R² to blend two different MACD coefficient sets. This makes the MACD line more responsive during strong trends and smoother in sideways markets. The indicator plots a color-coded histogram (strong/weak bullish/bearish) and an optional auto-contrast MACD line that adapts to the chart background. Inputs allow customization of the R² period, fast/slow lengths, signal period, and colors. Suitable for trend-following and detecting momentum shifts.

Detects order blocks — the last opposing candle before an impulsive move that breaks market structure — and draws them as zones that extend live until price returns and mitigates them. Structure breaks and mitigation are both evaluated only on closed bars, so nothing repaints.

Customize your MetaTrader 5 AI Assistant with selectable language, personality, menu and behavior using a simple prompt file.

Detects the gold symbol whatever the broker calls it, reads the contract specification from the terminal instead of assuming it, and turns a risk in account currency into a lot size that is correct for that broker.

Syncs all chart symbols to symbol of the chart the EA is attached to

A lightweight, essential utility for ICT and SMC traders. It automatically plots the True Daily, Weekly, and Monthly Open prices, serving as the foundation for the Power of 3 (Accumulation, Manipulation, Distribution) concept.

This is a simple program to compare asynchronous and synchronous all close. It is a sample program, so feel free to modify it for your own testing purposes, such as adding conditions.

A simple Expert Advisor that trades when the price forms the "Three From Within" pattern.

This EA will scan all the open trades and then print the nth trade from the end

Linear Regression Line

The CDebugLogger class is a flexible and comprehensive logging utility designed for use in MQL4/5 environments. It allows developers to log messages at various levels of importance (INFO, WARNING, ERROR, DEBUG) with options to include timestamps, function signatures, file names, and line numbers in the log entries. The class supports logging to both the console and files, with the ability to save logs in a common folder and in CSV format. Additionally, it offers functionality to silence logs based on specific keywords, ensuring that sensitive information is not logged. This class is ideal for developers looking to implement robust logging mechanisms in their MQL4/5 applications, with customizable features that cater to a wide range of debugging and monitoring needs.

Serialization and deserialization of the JSON format

Kuskus Starlight is an oscillator that utilizes a Fisher price transformation to identify trends and potential reversals. The original MT4 code by Scriptor is available at: /en/code/8365.

Price Alert MetaTrader indicator — can issue any type of alert when the price reaches certain levels set by a trader. There are three types of price levels: the first one is used when the price rises above certain level (displayed with the green line on the chart), the second one is used when the price falls below certain level (displayed with the red line on the chart), and the third one is used when the price reaches the certain level exactly (displayed with the yellow line). Three alert types include: native (popup), email, and push-notification. For email and push-notification alert features to work, you need to set up the email or MetaQuotes ID settings in your MetaTrader platform options window. The indicator is available for both MT4 and MT5.

Calculate a moving average in one function call. Code that can easily be transported between different projects.

A compound interest calculator for the trader. Calculates, based on your parameters, your risk of ruin, and the optimal risk per trade. Gives a forecast of your capital size in a year, month, and at the end of the term.

A hybrid sorting algorithm that provide fast performance for sorting arrays of simple types, structures or object pointers.

Professional Expert Advisor that automatically manages risk and calculates position size based on real market volatility (ATR). Intelligent capital protection system with dynamic stop loss mechanism, suitable for traders who want strict risk control.

This indicator detects bullish and bearish engulfing candlestick patterns with an optional volume filter to highlight stronger signals.

Works using a positive lock; the trading robot creates one positive lock, and the trader decides what to do with it.

The script shows the usage of L1 Trend Filter methods in MQL5 for float and double vectors on random walk simulated data.

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.

Hon-Matrix is an advanced algorithmic trading system that combines Price Action, Volatility Analysis, and Real-Time News Filtering. Unlike standard "static" EAs, Hon-Matrix utilises a dynamic decision-making engine that identifies the current market phase (Trending vs. Ranging) and switches its entry logic accordingly. It features a professional-grade on-chart dashboard allowing for live parameter adjustments without restarting the EA, making it a powerful tool for both automated prop-firm passing and personal capital growth.

An educational MT5 panel that maps the live price vertically inside four developing candles and summarizes location alignment, dispersion, candle direction and time remaining.

Draws parallel trend channels (Median, High, Low) on the current chart based on the last two closed candles of up to 7 higher timeframes (MN1, W1, D1, H4, H1, M30, M15), with individually configurable colors and line styles for each timeframe.

On-chart trade management utility for MetaTrader 5 designed exclusively to adjust existing manual or EA positions. Features one-click controls for Break-Even placement, point offsets, profit locking, trailing stops, Risk-to-Reward (1R–3R) Take Profit targets, and volume-validated partial closures (25%–100%). Includes a draggable chart GUI and filtering by symbol and direction. Does not open new trades.

Constructor for creating histograms of statistical distributions of indicators, timeseries and their derivatives.

Tester's single pass data.

Searches for Wick or Body based High low in visible bars of chart

MQL5 version of harmonic moving average

1...8910111213141516171819202122...220