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

MQL5 Source Codes of Expert Advisors for MetaTrader 5

icon

Expert Advisors analyze price charts and trade automatically following underlying rules. Here you can find MQL5 source codes solving a variety of problems. You are able to select both simple Expert Advisors based on moving average crossing and complex ones involving complicated signal generation algorithms and protection against trading mistakes.

You can download and launch offered Expert Advisors in MetaTrader 5. It is recommended that you test and optimize trading robots in the Strategy Tester before using them. The library of Expert Advisors is also available directly from MetaTrader 5 platform and MetaEditor development environment.

Submit your code

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.

Bidirectional grid EA for Gold (XAUUSD). Ideal for ProCent accounts. Includes Daily Profit Target and Max Drawdown protection.

BEC Trade Manager helps you manage active positions on the current symbol using one-click controls for breakeven, trailing logic, partial close, stop-loss removal, profit-side closing, loss-side closing, and fast scalp entries. It also displays key account and symbol information on the chart, including equity, floating profit, daily profit, stop-loss labels, and basket breakeven preview.

One-click trade panel for MT5 and MT4. Manage entries, exits, SL, TP, pending orders and partial closes without touching the keyboard.

RSI Grid Overlap Pro is a professional MT5 Expert Advisor combining RSI-based market entries with an adaptive grid recovery system. It features intelligent overlap order management to reduce drawdown, plus virtual trailing stop, breakeven, and three lot sizing modes — fixed, balance-proportional, and risk-based — making it suitable for both conservative and aggressive trading styles.

BEC is an advanced trade management Expert Advisor designed to automate breakeven, trailing stop, and position control — all from a powerful on-chart dashboard.

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.

Hon-APS (Advanced Pattern Scanner) is a sophisticated, open-source Expert Advisor for MT5. Unlike typical retail bots relying on lagging indicators, Hon-APS trades structural breakouts backed by quantitative Order Flow algorithms. It actively scans for classical chart patterns (e.g., Head & Shoulders, Bottoms, Triangles) and validates entries using L2 Order Book absorption and bid/ask imbalances. Complete with a polished on-chart UI, true Kelly Criterion risk management, and a robust macroeconomic news scraper, it's designed for prop-firm viability and high-end capital preservation.

KSQ Command Centre is a production-ready, two-way bridge between MetaTrader 5 and Google Sheets. It was originally designed to help fund managers and quantitative traders remotely monitor and manage large, funded accounts (e.g., Darwinex Zero, Prop Firms, PAM, MAM) directly from a mobile browser, without needing to log in to a VPS. This Expert Advisor not only exports data—it actively listens for commands typed into your Google Sheet and executes them in MT5 in near real-time.

ASQ CommandDesk is a professional order management panel for manual traders on MetaTrader 5. You make the trading decisions — CommandDesk handles execution, risk control, and exit management automatically.

KSQ Fair Value Gap EA automatically trades institutional FVG zones with built-in regime detection to filter out low-quality setups in ranging markets. STRATEGY Detects 3-bar bullish and bearish FVG patterns. Enters on confirmed pullbacks into the zone. Each FVG fires once only. REGIME FILTER EMA trend bias, ADX strength filter, or both combined. Configurable higher timeframe (M15–D1). SL & TP Both support ATR-based or fixed-points mode, set independently. LOT SIZING Fixed lot or % risk-based — switchable from inputs. TRADE MANAGEMENT Break-even stop, partial close, and ATR/points trailing stop. RISK PROTECTION Daily and total drawdown kill switches. Max trades per direction cap. Session time filter. It's not yet optimised for any pair

A daily bias Expert Advisor that trades market dominance, analyzing previous day bullish vs bearish control with MA confirmation, and executing a single, minimum-volume trade with ATR-based risk management.

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.

ASQ RiskGuard is a risk management Expert Advisor for MetaTrader 5 that protects your account from excessive drawdowns. It monitors equity in real time, enforces daily loss limits, guards against high spreads, filters trading sessions, and provides a visual risk dashboard — all running silently alongside your other EAs.

ASQ FlowDesk is a streamlined trading panel for MetaTrader 5 that provides one-click order execution, scaled take-profit exits, adaptive trailing stops, auto-breakeven, and a live analytics dashboard — all from a clean on-chart GUI.

This EA serves as a template for traders interested in automating strategies in MT5. It implements a Moving Average crossover system and can be used as-is or customized by adjusting its settings. The free source code is designed to be easily modified for adding new indicators, logic, and trading features.

This Expert Advisor (EA) is designed to detect swing highs and lows on the H4 timeframe, then wait for sweeps (liquidity grabs) on the M15 timeframe to trigger buy/sell trades with defined risk management.

A professional trade management utility that completely hides your Stop Loss and Take Profit levels from brokers. It features a Spread Protector to prevent virtual stop-outs during news events or daily rollovers.

This Expert Allows You To Run and Play DOOM (The Game) on MetaTrader5! It's A Take On The Infamous "Can It Run Doom?" Challenge.

Regime-adaptive grid EA with three operating modes (BGT/TGT/MGT), ATR-dynamic spacing, CUSUM change-point detection, equity-based cycle management, and a full CSV diagnostics pipeline. Based on the Bi-Directional Grid Constrained (BGC) stochastic process research by Taranto & Khan (2020–2022).

A strict Multi-Timeframe Price Action Expert Advisor that trades based on precise OHLC conditions across different timeframes simultaneously. It features pending order entries, role reversals, and dynamic risk management without using any lagging indicators.

Just two timeframes — H1 and D1 — work synchronously to filter out the noise and capture only strong RSI reversals from overbought and oversold zones. No random entries, only a clear confirmation of the direction from the "big brother."

Connect your MetaTrader 5 account to Telegram. Receive instant notifications every time a trade opens, closes, or gets modified — directly in your phone. This is a notification-only Expert Advisor. It does not place, modify, or close any trades. It monitors your account activity and sends formatted messages to your Telegram chat via the Bot API.

SilviosEAbest26 is a high-precision Expert Advisor for MetaTrader 5, designed to trade market reversals using a sophisticated combination of dynamic price channels and momentum filters. The system is engineered for consistent returns while maintaining strict risk management protocols.

Professional trade management panel: one-click Buy/Sell with auto lot sizing, smart trailing stop (ATR/Fixed/Candle), automatic breakeven, multi-TP partial close system (TP1/TP2/TP3), and one-click pending orders. All-in-one order management for serious traders.

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

A simple trading strategy based on breakouts of prior Highs and Lows.

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.

Price Action Day Trader is a robust, trend-following MQL5 Expert Advisor designed for intraday trading. It focuses on high-probability price action patterns Pin Bars, Engulfing Candles, and Inside Bar Breakouts while filtering trades through a dual Moving Average trend filter.

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

Martingale trend detector use onnx AI

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

Automated trend-following EA using EMA, RSI, and Stochastic signals to open trades on the last closed candle with Stop Loss and Take Profit.

A professional on-chart panel for instant lot size and risk calculation. Essential for manual traders using strict risk management.

The classic version of the Heads or Tails trading strategy with the analysis of the signal block code.

RiskSizer Panel Lite is a simple MT5 trading panel that calculates an estimated lot size based on your risk percent. Drag two chart lines to set SL/TP, then use one-click BUY/SELL for fast manual execution.

adoption of Larry William's method using AI Time-Series XGBoost

The Playground EA series was created for experimentation with Fair Value Gaps (FVGs) and liquidity concepts

This EA is intended to test a popular trading strategy. My own backtest shows that this strategy does not work as it was intended

Utility MT5 EA that sends BUY/SELL deal notifications to Telegram via Bot API (WebRequest)

123456789101112131415161718192021222324252627282930313233343536373839