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

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

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)

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

KopierMaschine is a local copier of trades between different MetaTrader 4 and MetaTrader 5 accounts in any direction located on one computer with an intuitive interface.

Expert Advisor based on iPinBar Pin Bar Finder + several different trailing indicators

A simple strategy based on the signals of two indicators: Williams' Percent Range (WPR) and Bollinger Bands (BB). A position is opened only when the signals of both indicators coincide.

A system to test up to four indicators concurrently in the strategy tester

This is an auxiliary take profit and stop loss tool, which can help you to tight stop loss and dynamic take profit. Updated

I share my code for expert advisor babi ngepet

Simple_Grid is the simplest "grid" EA.

Quantum System - Uses quantum states and probabilities to make decisions.

The RSI Engine EA is a highly versatile automated trading robot for MetaTrader 5, designed to execute trades based on signals from the popular Relative Strength Index (RSI) indicator. Version 2.1 features optimized signal processing and enhanced stability. The EA provides a flexible framework with multiple RSI-based strategies, confirmation filters, and comprehensive trade management settings, making it suitable for both novice and experienced traders.

Introducing MP by SPLpulse, a sophisticated and highly versatile Expert Advisor designed for the modern trader. Whether you are a scalper, a trend follower, or a reversal trader, MP by SPLpulse combines multiple trading strategies with an institutional-grade risk management suite to adapt to your unique trading style. Take control of your trading with unparalleled customization and powerful automation.

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

1234567891011121314151617181920212223242526272829303132333435363738