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

Submit your code

The indicator displaying multi level of ATR Channel.

Fractal with CCI Filter - Indicator that combines traditional fractals with the CCI filter to reduce false signals. Shows red arrows above the candles for bullish fractals (sell) when the CCI is above the configured threshold and green arrows below the candles for bearish fractals (buy) when the CCI is below the negative threshold. Perfect for identifying reversal points with greater reliability.

This is an example of ascending sort a struct list by a field. You can find out and customize the above algorithm depending on the purpose of use, this is the most basic example is also a direction to resolve the arrangement in an array of structure. The algorithm used in this example is Quick Sort and Merge Sort.

PriceVar% is an indicator designed to measure the percentage difference between the price and a moving average, highlighting the strength of the market movement in relation to a reference value.

Instantly calculate the profit and loss potential of your trades directly on the chart. An essential tool for agile and precise risk management.

WaveWeisBarForce is a custom indicator based on Weis Waves logic. It accumulates volume into directional waves (bullish or bearish) and displays them as histograms with intensity levels. Bullish waves: 4 levels of green, from light to Lime. Bearish waves: 4 levels of red, from light to Red. WaveMax (white): shows the bar with the highest volume inside each wave. WaveClimax (yellow): highlights record accumulated volume across waves. This indicator helps traders visualise market pressure by volume accumulation and wave intensity, improving intraday and swing analysis.

MACD Histogram

A simple indicator based on Bollinger Bands showing its narrowing and widening phases with red/green colours.

Scan multiple symbols and timeframes for wick-based rejection candles and display the latest signals in a clean on-chart dashboard with strength scoring, signal age, optional markers, and alerts.

Market Structure Expert Advisor use LightGBM (Light Gradient Boosting Machine)

Function for modifying open positions and pending orders

Allow the EA to determine whether there are duplicate EAs on the chart based on conditions.

A simple binary trading strategy that counts candle colors.

This indicator combine WPR and total profit/loss. I don't know how to tell you more about this indicator but you can try it.

Trend based grid Expert Advisor for MetaTrader 5 using EMA and RSI indicators. Dynamic lot size is calculated from account balance with minimum and maximum lot protection. Initial trade opens when price confirms trend direction relative to EMA and RSI levels. Grid orders are added at fixed point distance using controlled multiplier. All trades are managed as a basket and closed at defined profit target or maximum loss level. Includes optional news hour pause and market close filter. No DLL or external services required.

Include-file class that measures inter-tick latency, filters false alarms via a self-normalising ATR volatility gate, and broadcasts persistent lag alerts to other EAs via GlobalVariable IPC.

ExMachina Safe Scalping is a professional-grade Expert Advisor built for conservative breakout scalping on Gold (XAUUSD), Silver (XAGUSD), and Forex majors.

Real-time prop firm rule tracker: daily drawdown, max drawdown, profit target progress, trading days count, and challenge status with visual progress bars. Presets for FTMO, MyFundedFX, E8, TFT, and Bulenox. Pure indicator — no trade interference.

A lightweight tick-driven dashboard that reveals short-term Bid-Ask pressure directly on the chart.

Trade With MA Trends ATR TPSL Line and The Line Of Pivot Point

Highlights Inside Bar candlestick patterns on the chart and provides optional popup and push alerts when a new pattern is detected.

The standard MACD on MT5 platform seem to be not enough so I code this version by copying from the pinescript.

Portfolio Scorer is a standalone MQL5 script that evaluates the quality of a multi-EA portfolio across three critical dimensions that most algo traders overlook. The script reads daily profit and loss data from CSV files (one per Expert Advisor), computes a full Pearson correlation matrix between every strategy pair, maps trading activity by UTC hour and weekday, detects asset class diversity, and produces a weighted composite score with a letter grade from A+ to F. How it works: The tool runs in four sequential stages. First, the Data Loader reads and validates CSV files containing daily returns for each EA in the portfolio. Second, the Correlation Engine calculates the complete NxN Pearson correlation matrix and flags pairs that exceed a configurable threshold. Third, the Coverage Analyzer maps which hours and weekdays have active trading and identifies blind spots. Fourth, the Scoring Function combines all three dimensions into a single composite score using adjustable weights.

MT5 indicator showing bar index, price difference in points, and percentage change. Ideal for EA integration and fast analysis.

Institutional-grade forex session detection and analysis library for MetaTrader 5.

Runtime trade frequency adjustment library for MetaTrader 5.

Professional Telegram integration library for MetaTrader 5 EAs.

Institutional risk analysis library for MetaTrader 5. Zero external dependencies. Pure MQL5 mathematics.

Centralized indicator handle management library for MetaTrader 5 EAs.

On-chart candle analysis indicator with structure tags, sentiment, and trend arrows for MetaTrader 5.

ASQ PropGuard is a real-time prop firm rule monitor for MetaTrader 5. It tracks daily loss limits, maximum drawdown, profit targets, and trading day requirements — all displayed on a dark-themed chart overlay with color-coded progress bars and a live pass/fail verdict.

An unsupervised machine learning indicator that applies the K-Means clustering algorithm to historical price action, mathematically detecting and plotting the true institutional liquidity pools without human bias.

Swap Monitor Panel is a lightweight, fully customizable indicator that overlays a live swap rate dashboard directly on your MT5 chart. It scans every symbol in your MarketWatch window and presents long swap, short swap, estimated daily cost, and weekly cost side by side — all in one clean, readable panel.

Symbol Summary is a service for MT5 that opens a separate viewer window and shows a detailed report on a trading symbol. It supports Russian and English language, window resizing, scrolling, automatic report update when changing symbol or timeframe of the chart without restarting the service.

This mini custom-built MetaTrader 5 dashboard is a robust, comprehensive risk management and performance based monitoring tool and utility created to give both Prop firm and personal funded traders full visibility and control over their trading activity in real time.

Interactive Correlation Heatmap using high-performance MQL5 matrix functions. > Features a draggable, minimizable dashboard with instant multi-timeframe switching and a vivid 5-band color scale for real-time currency relationship analysis.

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.

A chart-cleanup + quick-trading layer for MT5

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.

1234567891011121314...205