Watch how to download trading robots for free
Find us on Facebook!
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

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

Utility MT5 EA that sends BUY/SELL deal notifications to Telegram via Bot API (WebRequest)

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

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

A simple binary trading strategy that counts candle colors.

Download all tick history available and save it in a file, either for one symbol or for all in Market Watch

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

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.

In Part 6 of the "MQL5 Programming for Traders", we will study a key component of the MQL5 language – trading automation. We will start with a description of the fundamental entities, such as financial instrument specifications and trading account settings. These are prerequisites for creating properly operating Expert Advisors.

Alligator beginner tutorial to learn how to code in MQL5

This is an indicator with a rainbow-like display, both for trend or pullback prediction.

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.

The indicator draws an arbitrary second timeframe on the chart.

A volume oscillator is a useful technical analysis indicator that predicts the strength or weakness of price trends

12345678910...195