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

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.

The WaveTrend Indicator (WT) is a powerful technical analysis tool designed to identify trend direction and potential reversal points. It plots two lines, WT1 and WT2 , in a separate window, calculated based on price momentum and smoothed averages.

A stripped-down (signal line only) version of Metaquotes' MACD indicator from the MT5==>Indicators==>Examples folder.

This powerful tool filters the classic RSI through a moving average, providing a smoother, more reliable signal line for pinpointing entries, exits, and trend direction with unparalleled clarity.

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

Intelligent position protection with one-hedge-per-position logic. Features magic number separation, cooldown timer, and max hedges limit. Prevents infinite hedging loops. Free MIT license.

Provide simplest class to write CSV file

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.

Modified standard ZigZag indicator with the addition of information about wavelength in pips, levels and different alerts logic

Adaptive CCI - Commodity Channel Index with dynamically adjusting upper and lower limits based on market volatility. Eliminates fixed thresholds (like 100/-100) by using EMA-smoothed peaks and troughs, providing more reliable overbought/oversold signals tailored to each asset's current volatility. Perfect for identifying high-probability reversal points with adaptive confirmation levels.

Logify is a logging library for MQL designed to simplify debugging, tracking, and monitoring of EAs and indicators. It provides structured, customizable, and organized logs directly on the chart or in the terminal, with support for log levels, flexible formats, and multiple handlers. A lightweight, elegant solution that is easy to integrate into your MQL projects.

Trade server disconnect alerts utility for MT5.

An indicator to detect and mark all popular candle patterns

A lightweight tool for manual scalping in MT5 using keyboard shortcuts

A price increase indicator calculates margin and price changes in per cent.

TardioBot V1.05, named after of a historical figure Giuseppe Tardio, is an Expert Advisor designed for MetaTrader 5 that employs a triangular arbitrage strategy.

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.

123456789101112...195