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

Submit your code
PNG

Forget about BMP files like a bad dream. Thanks to this library, you can now use the PNG format, which has a number of advantages, such as being more compact without losing image quality and maintaining transparency.

In the fourth part of the book, we will focus on mastering built-in functions (MQL5 API) and will gradually delve into specialized subsystems. Any MQL5 program can utilize a plethora of technologies and functionalities. Therefore, it makes sense to begin with the most simple and useful functions that can be utilized in most programs.

The Heiken Ashi indicator with no repaint or repaint mode input option.

Combine Multi Timeframe Trends into one trend using MA.

Another ZigZag. ZigZag

Unfortunately, I discovered that some brokers are a bit sloppy with the server time change due to the daylight saving time (DST), which I did not expect and which surprised me a lot. Here is a script with which anyone can check their broker.

A set of classes for automatic moving of StopLoss of open positions by fixed indentation or by values of Parabolic SAR and moving averages indicators, or by specified position stop level.

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

combination of many familiar indicators for beginner traders

The Playground EA series was created for experimentation with Fair Value Gaps (FVGs) and liquidity concepts

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.

ExMachina Safe Scalping is a professional-grade Expert Advisor built for conservative breakout scalping on Gold (XAUUSD), Silver (XAGUSD), and Forex majors.

Calculate DST for USA, EUR, AUD and RUB and the offset time of the broker automatically from the 70's until 2030 - even in the Strategy Tester of MQ.

The final seventh part of the book discusses the advanced capabilities of the MQL5 API, which will be useful when developing programs for MetaTrader 5. These include custom financial symbols, built-in economic calendar events, and general-purpose technologies such as networking, databases, and cryptography.

This indicator displays current events on the chart and allows you to export the calendar to archives for backtesting, automatically fixing time discrepancies between the history of bars and the history of events. This is an improved version of CalendarMonitorCached indicator from the algotrading book.

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.

In Part 5 of the book, we'll delve deeper into the APIs associated with algorithmic trading, including financial data analysis and processing, chart visualization, automation, and user interactions.

Working with keyboard data

A simple comment.

Highlights the Forex Market Sessions (Sydney, Tokyo, London, New York).

The indicator searches the chart for Price Action patterns "Pin Bar" and puts icons on the bar with the found pattern.

This is an OHLC candlestick chart which records the highest ask and lowest bid on each new bar

The indicator implements one of the non-linear smoothing algorithms

adoption of Larry William's method using AI Time-Series XGBoost

Part 2 "MQL5 programming fundamentals" is an introduction to the key concepts of this programming language. This part of the book is devoted to data types, identifiers, variables, expressions, and operators. You will learn how to combine different instructions to form the program logic.

AO - Awesome Oscillator - without iAO() beginner tutorial to learn how to code in MQL5

The AutoCloseOnProfitLoss Expert Advisor (EA) is a powerful automation tool for MetaTrader 5, designed to close all open positions when predefined profit or loss targets are reached

Candle Replay Magnifier visually replays historical candles over the current chart area for comparative analysis. This indicator overlays past price bars from a selected date onto the live chart, allowing traders to study candle patterns, volatility, and structure in real time. Includes dynamic range highlighting and detailed tooltips showing open, high, low, close, range, direction, time, and volume for each replay candle.

Professional Telegram Bot integration library for MetaTrader 5. Complete solution for sending trading signals, screenshots, reports, and real-time notifications to Telegram channels and groups.

A JSON library that supports MQL4/MQL5

An advanced, institutional-grade trend-following engine using Z-Score adaptive volatility, smart money volume filters, and a real-time MTF dashboard.

Rsi without Irsi() beginner tutorial to learn how to code in MQL5

Idea by Andrey F. Zelinsky, based on an indicator by William Blau

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

This library is an updated version of the ErrorDescription.mqh library published by MetaQuotes, with some features included.

An example of a bot with an embedded machine learning model that is trained in python and saved in ONNX format.

This script helps traders understand the distribution and breadth of candlesticks over a specific period, which can be useful in making trading decisions such as which Take Profit or Stop Loss to use based on historical values.

Correlation Coefficient" indicator

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195