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

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.

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

This indicator implements the "Quarters Theory" - a technical analysis concept that divides price movement into four quarters around a central base level. It's designed to work with multiple asset types (Forex, stocks, commodities, etc.) and provides visual quarter levels on the chart.

Professional panel for closing positions with 6 smart filters. Close all, by type, by symbol, or by profit/loss. Real-time P&L display. Perfect for emergency exits and risk management. Includes safety confirmations.

It's like a bird's-eye view for BBMA Oma Ally fans. ust drag it onto the chart and you'll get all the BBMA signals running on the chart.

The script provides a quick estimation of an exponent/power factor for transformation of variable-length price increments into uniform distibution, that makes them a "random walk". The estimated value characterizes current symbol as more profitable when using in a particular trading strategy.

Horizontal Grid Controller with KeyEvents

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.

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

A simple strategy based on the signals of two indicators: Williams' Percent Range (WPR) and Bollinger Bands (BB). A position is opened only when the signals of both indicators coincide.

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

This code does not trace the iatr() because the iatr() or this code is a more modern version. This code uses original smoothing, a kind of SMA and not wilder smoothing. The analysis of the two smoothings can suggest opportunities elsewhere

Modification of the standard indicator Fractal

This library simulates prop trading firm scenarios by resetting the account balance based on configurable profit and loss thresholds during backtesting, and logs reset results for analysis.

Translate risk percentages to the monetary figure based on the account balance

This MQL5 script exports candlestick data for various timeframes into a CSV file, capturing essential market information like open, high, low, and close prices. It analyzes each candlestick's characteristics, including body and wick sizes, while calculating additional metrics such as candle gaps. After processing the latest 21 bars, it notifies the user upon successful data export.

Marking the extreme highs and lows (OHLC) together with the extreme bid and ask prices

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.

Keltner Channel (MetaTrader indicator) — is a classical technical analysis indicator developed by Chester W. Keltner in 1960. The indicator is somewhat similar to the Bollinger Bands and Envelopes. It uses three plot lines: the middle line is the 10-day simple moving average applied to the typical price ((high + low + close) / 3), the upper and the lower bands are produced by adding and subtracting the moving average of the daily price range (High and Low difference) from the middle line. This way, a volatility-based channel is built. In this version of the indicator you can modify all the parameters of the MA. The indicator is available both for MT4 and MT5 versions of the platform.

Logger with the ability to log individual modules or code sections

Simple Expert Advisor with custom R-squared optimisation function

Dynamic VWAP level which can be averaged over multiple days

The Watermark indicator is lightweight and efficient, designed to display an informative watermark over the main MetaTrader 5 chart. It automatically shows the current symbol, chart time and asset description, allowing traders to customise their interface with style and convenience.

12345678910...194