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

MQL5 Source Codes of Expert Advisors for MetaTrader 5 - 2

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 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.

ICE Pro v1.0: Momentum Intelligence System. ICE isn't just a static indicator-based EA (Expert Advisor). It's an Adaptive Trading engine that uses volatility (ATR) and volume profiles as primary filters to determine which price movements are "True Impulses" and which are simply "Market Noise."

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)

Fox Wave Clean - Professional Order Manager Professional EA for efficient trade management with one-click position control. Clean design, powerful functionality.

The Expert Advisor works with pending orders Buy Stop and Sell Stop according to the time specified in its input parameters.

The simplest Expert Advisor that analyses the price movement on a given number of bars and opens a corresponding position.

Overview Grid Master EA is an automated trading system that implements a bidirectional grid strategy. It places multiple pending orders above and below the current market price, capturing profits from market oscillations in both directions.

The EA only trades buy positions and does not use Sl and TP.

Professional panel for closing positions with 6 smart filters. Close all, by type, by symbol, or by profit/loss. Real-time P&L display. Perfect for emergency exits and risk management. Includes safety confirmations.

The function calculates the lot size of an open position. The opening price of a deal, the price of stop loss level and the risk per deal in per cent of the deposit are passed as parameters

An example of adding buttons for your advisors. In this example, a button has been implemented to close all active positions for all instruments. In addition to the button event processing functionality, methods for closing positions relative to the symbol name and counting the number of positions relative to the symbol name are also implemented.

An example of a bot with an embedded machine learning model that is trained in python and saved in ONNX format.

The two moving averages crossover strategy is one of the most common trading strategies in the financial market. It is based on the use of two moving averages (usually long and short term) and signals an entry into a position based on their crossover.

Closing martingale trades

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

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

Probability Theory Advisor

123456789...40