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

Top MQL4 and MQL5 source codes based on user ratings - 3

Submit your code

ATR - Average True Range - beginner tutorial to learn how to code in MQL5

This indicator uses two moving averages to calculate the market trend and changes color depending on the trend direction.

This indicator calculates the range difference between the 'MACD and Signal lines' and also the range distance between 'the last two MACD bar'.

Real-time display of Binance quotes

This is a script to export rates and ticks of current chart's symbol into CSV-files compatible with MT5's export/import format.

Script for displaying updating data on open positions.

Population-based optimisation algorithms are collected here. The archive contains all necessary files to run the algorithms on test functions.

Copy and paste selected graphical objects between charts via Windows clipboard as text. Use Ctrl+Q on a source chart, then Ctrl+J on a target chart.

A new interface library has been developed to simplify the process of converting MT4 indicators and Expert Advisors (EAs) to MT5. This library supports most of the MetaTrader 4 functions, offering developers a unified solution for cross-platform compatibility.

An advancement of the MetaQuotes zigzag with an oscillator mode, current bar leg tracking, fib levels, and dynamic scaling

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.

Laguerre MetaTrader indicator — a completely custom indicator that doesn't rely on the standard MT4/MT5 indicators. It shows the weighted trendline in the separate window of the chart. It can be used for simple entry and exit signals. The indicator is available for both MT4 and MT5.

Time to candle Close. Dynamic text colours. Optimised for back-testing.

This Expert Advisor (EA) implements a triangular arbitrage strategy between three currency pairs: EURUSD, USDJPY and EURJPY

The DailyHighLow indicator is a versatile tool designed for MetaTrader 5 (MQL5) to display high and low price levels on a chart based on a specified timeframe. This indicator is particularly useful for traders who rely on key price levels for decision-making, offering flexibility through customizable timeframes and price calculation methods.

A professional script that automatically sets Stop Loss and Take Profit for all open positions based on a customizable Risk:Reward ratio. Perfect for traders who want to maintain consistent risk management across their trades.

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.

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

This indicator builds a dynamic price channel using Gaussian smoothing to determine support and resistance lines. It calculates smoothed high and low price values for a given period, finds their extrema and displays three lines: upper resistance (maximum of smoothed high), lower support (minimum of smoothed low) and the middle line between them, forming an adaptive trading channel.

This Screener was created to simplify the process of finding assets trading at discounted prices. Initial usage may take slightly longer due to the data loading process for all selected instruments. The tool can scan all available broker assets or be limited to specific asset classes.

Securing data transfer between client and Server could be a big challenge for you as MQL5 programmer. You may have experience in using built in MQL5 encryption systems like AES.AES can securely encrypt your data but on the other hand is not secure when it comes to sending the AES key through insecure channels. You can only rely on asymmetric encryption systems Like RSA in such cases. you keep the private key at your server side and only share the public key with your clients. Even more you can use hybrid RSA_AES approach to archive more performance

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

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

A chart-based risk monitor for prop-firm style rules: draws a live “Dead-Line” price level showing where your Daily Loss Limit or Overall Max Drawdown would be violated, based on equity, open exposure, and optional trailing drawdown.

Automates MQL5 buffer and plot index management. Eliminates manual counting, simplifies Z-order layering, and handles complex plot types (Candles, Color Lines) with a single line of code.

Adaptive VWAP Institutional: Multi-Asset Auto-Detection & DST-Accurate Session Resets (Forex 5PM NY Standard).

Log

Multi-Mode Logarithmic Transform Indicator.

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

This script serves as a practical example of how developers can programmatically work with files using MQL5. One of its key objectives is to demonstrate effective project file organization, which is essential for developers working on large-scale systems or aiming to create portable, self-contained projects. The concept can be expanded further and refined with additional ideas to support more advanced development workflows.

A simple binary trading strategy that counts candle colors.

Download all OHLC data history available and save it in a file, either for just one symbol or for many in Market Watch

The FMO indicator is a technical analysis tool that measures "trend age" using fractal cycles. Its purpose is to help traders determine whether a trend is still young (safe to follow) or over-aged (high risk). A Conceptual Synthesis of Psychology, Sociology, and Life Cycles This work presents a deep analysis of human life through a numerical matrix (3, 7, 39, 49), using it as a conceptual lens for understanding psychology, sociology, and developmental cycles. It is not a conventional scientific framework. Rather, it is a synthesized model — integrating esoteric, psychological, and sociological perspectives into a unified cyclical structure. The goal is to organize and interpret human development through layered, interacting cycles.

Draws the previous day High, Low, and Close as horizontal reference lines on the chart for a configurable number of past days. Yesterday's levels extend into today as live support and resistance, with optional touch alerts.

Library for trading session control. At startup it counts the time of trading sessions for all 7 days of the week (on Sat and Sun there can be cryptocurrency trading), up to 10 sessions per day. Then in OnTick() you can do checks, and if a tick came in outside the trading session, you can exit further processing of it.

The source codes written during the development of the library for creating multi-currency Expert Advisors that combine many instances of various trading strategies.

Modification of the standard indicator Fractal

Engulfing Bar Occurs below Ema moving Average that is rising - Buy Trade -

This service periodically checks swaps for predefined symbols and saves detected changes into CSV-files for further analysis and potential replay (not implemented here). Also it monitors and alerts swap changes of existing positions.

PrintXYZ() library to print massive information from the terminal.

A lightweight tool for manual scalping in MT5 using keyboard shortcuts

12345678910...195