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 Code Library for MetaTrader 5 - 5

icon

This is the largest free source code library for MetaTrader 5 platform programs. Here you can find ready-made Expert Advisors, technical indicators, scripts and libraries. Use the code library when learning MQL5 language and develop your own automated trading applications based on the provided codes.

You can freely download and test published codes, as well as launch them in MetaTrader 5. The library is also available directly from MetaTrader 5 platform and MetaEditor development environment.

Submit your code

Expert Advisor for MetaTrader 5 that combines Exponential Moving Averages (EMA) and Relative Strength Index (RSI) to generate trading signals. Includes risk management features and trading time filter.

The Cincin EA (v2.24) is an automated trading system for MetaTrader 5 that executes conservative random trades on a specified symbol (e.g., EURUSD), with features like basket management, hedging, and position control.

CloseAllOrders is a powerful and user-friendly Expert Advisor designed to simplify trade management in MetaTrader 5. With an intuitive button interface directly on your chart, you can close all market positions and pending orders instantly with just one click.

EA Spread lister shows the current, min and max values for all symbols / instruments.

A powerful and feature-rich JSON library for MQL5, designed to bring a modern development experience similar to Python/JS

The EA identifies trade setups by waiting for a user-defined number of indicators (e.g., 2 out of 3) to show divergence simultaneously. This multi-layer confirmation approach filters out market noise. Key Features: Triple Confirmation Engine: Analyzes RSI, MACD, & Stochastic divergence. Advanced Filters: Optional Trend Filter (MA) and Volume Filter for superior signal quality. Full Customization: Control all indicator settings, divergence sensitivity, and trade logic. Professional Risk Management: Use fixed lots or percentage-based money management with SL/TP.

It is an indicator that determines target levels according to the average of price movements.

Tarantella EA: Advanced grid trading system with hedging capabilities and Market Profile integration. Uses ADX trend filtering, Fibonacci-based grid spacing, and multi-layered entry conditions (RSI/ATR/volume) to execute trades only within Market Profile value areas. Features intelligent risk management including trailing stops, breakeven triggers, and partial hedge closing.

Interface for implementing asynchronous execution of algorithms

Profit Maximiser (PMax) Indicator is an indicator created by integrating the moving average of the Supertrend indicator.

BotCilento is a sophisticated grid-trading Expert Advisor for MetaTrader 5 that combines trend-following signals with adaptive risk management.

Zigzag which changes wave direction based on price percentage change on the asset

Historical equity of one-time and one-time open virtual positions to analyse the efficiency of spread/equity trading

This script is a reference solution for mapping symbol names configured by users in MetaTrader 5 EAs or scripts to the actual names provided by the broker. It uses the Levenshtein distance algorithm to automatically identify the most similar symbol in Market Watch. Ideal for developers facing compatibility issues with prefixes or suffixes in symbol names. It is a customisable starting point to suit any specific need.

Breakout Trader 1.0 trades breakouts from the range.

The indicator implements some of the most interesting approaches to measuring correlations

Testing on history in the MT5 tester maths mode.

Indicator Description – Bollinger Bands Crossover Signals Name: Bollinger Bands Crossover Signals Version: 1.1 Author: BENALI Link: https://www.mql5.com/en/users/dahmi_benali

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.

The Standard fractals are 2 candles to the right and 2 candles to the left. With this Custom Fractals you can choose as many candles as you like, both to the left and to the right.

ATR %, ATR percentage, ATR percentage, ATR percentage, ATR percentage

This expert is a system to help any trader to make a grid of orders.

The Value Area Retracement indicator, is a powerful volume profile-based tool designed to identify key trading levels—Point of Control (POC), Value Area High (VAH), Value Area Low (VAL), and Profile High/Low—across different timeframes. It helps traders spot potential retracement opportunities to the POC, breakout zones, and value areas, making it useful for intraday, swing, and position trading.

A short format for storing ticks.

Automatic Fibonacci retracement indicator that intelligently detects market waves and draws Fibonacci levels without manual intervention.

Unfortunately, I found that some brokers Changing the time on the server is a bit incorrect, which I didn't expect. and which surprised me a lot. Here is a script that anyone can use to check their broker.

Unfortunately I had to realise that some brokers are a bit careless with the server time changeover, which I had not expected and which surprised me a lot. Here is a script with which everyone can check their broker.

EQ

Historical equity of one-time and one-time open virtual positions to analyse the efficiency of spread/equity trading

An indicator that provides a clear visualization of volume pressure on each side of the market

BBMA ZoneZeroLoss Histogram shows trading zones e.g. for "Reentry" setup for risk minimisation

An automated Expert Advisor that implements a popular MACD-based strategy as seen in a viral YouTube video with over 3.5 million views. Combines MACD crossovers, trend filtering with the 200 MA, and support/resistance detection.

A lightweight, customizable tool that displays server time on your chart for precise trading decisions.

Name of expert is 'MultiStrategyEA'

This MetaTrader 5 (MT5) custom indicator, boomSpikeBoxMitigationFinal.mq5, detects a specific bullish spike pattern on the chart and marks entry zones using rectangles and horizontal lines. Once the price returns to ("mitigates") the entry level, the entry line is shortened to the mitigation point.

A class for reading and writing individual bits or bit sequences to and from a buffer.

This indicator detects a specific bearish spike formation over 3 candles

MQL5 script for MetaTrader 5 that adds two buttons to close all buy or sell positions for the current symbol.

This is a simple script file to compute lot size either using risk percentage approach or the actual amount to risk.

The SuperTrend Indicator is a dynamic trend-following tool based on ATR. It plots a colored line above or below price to indicate bullish or bearish conditions. When the price crosses the line, a signal arrow appears. Fully customizable with ATR period, multiplier, arrows, labels, and colors. Suitable for all instruments and timeframes. Ideal for scalping, swing, and intraday trading. Combine it with other indicators for stronger setups.

This simple indicator is to find out easily when the price reaches a particular time on any candle or time frame.

123456789101112...195