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 - 4

Submit your code

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.

This EA is designed to automatically follow market trends using signals from the Moving Average and Stochastic Oscillator indicators. The EA detects buy and sell signals by utilizing MA crossovers and confirms the trend with Stochastic. Additionally, the EA includes automatic position management, such as setting Take Profit, Stop Loss, and lot size doubling to enhance trading effectiveness in trending markets.

BBMA ZoneZeroLoss Histogram shows trading zones e.g. for "Reentry" setup for risk minimisation

Donchian Ultimate MetaTrader indicator — is a classic Donchian channel indicator with multiple features added:

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.

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

A zigzag indicator that uses a single input to adjust the step size for detecting wave direction changes

TelegramToMT5 is a MetaTrader 5 Expert Advisor that bridges Telegram and MT5 by displaying messages from your Telegram channels, groups, and private chats directly on your trading charts. Simply create a Telegram bot, add it to your desired channels/groups, and let the EA show all messages as comments on your chart in real-time.

This MQL5 custom indicator detects divergences between price action and the Awesome Oscillator (AO), signalling potential market reversals or continuations. It plots buy/sell arrows on the chart, displays the AO as a histogram, and draws trendlines to highlight divergences.

Indicator that displays the day's trend at any chart time. You can customise the colours and position of the text on the screen.

Countdown is an advanced indicator designed for traders who want to track the time remaining until the next candlestick or the next market open clearly and efficiently. With three flexible display modes (commentary, chart borders or next to price), this indicator offers a customisable solution to suit your trading needs.

This EA is meant to impose a few rules to manage baskets.

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.

This indicator is a utility that shows labelled trade levels on any chart. If you want to replace your native trade levels on a native chart, then turn off "Show trade levels" in your F8 Chart Properties and attach this indicator. If you want to show trade levels on a Custom Chart (where native trade levels cannot be shown), then simply attach this indicator. BaseSymbol - specify the Symbol from which the trade level data will be pulled--handy for unique Custom Symbols. TextBarsBack - specify the number of bars back in history from the current bar where the level labels will be drawn. Note: Although magic number is referenced in the code, it is not presently included in the trade lines. If you're running multiple EA's on the same Symbol, you can edit the code to show magic numbers and then run multiple instances of the indicator on one chart. You can also edit the font sizes and text spacing in the object properties as needed for different display resolutions.

Combines a Moving Average with ATR-based upper and lower bands to act as a trend filter and volatility channel.

The indicator displaying multi level of ATR Channel.

This is a Moving Average indicator based on Heiken-Ashi candles instead of raw market price.

A Simple RSI and Moving Average-Based Expert Advisor for MQL5

Weekly VWAP (Volume Weighted Average Price) is a powerful MQL5 indicator that calculates and displays the Volume Weighted Average Price for each trading week. It's a crucial tool for identifying weekly fair value and understanding the underlying sentiment over a longer timeframe.

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.

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

BotCilento is a sophisticated grid-trading Expert Advisor for MetaTrader 5 that combines trend-following signals with adaptive risk management.

A powerful and feature-rich JSON library for MQL5, designed to bring a modern development experience similar to Python/JS

Super pass-band filter as described by John Ehlers

RMA Relative Moving Average is a variant of EMA

This is an indicator that helps identify Engulfing candle patterns.

This is an indicator that combines swing high/low and Fibonacci Retracement to identify potential buying zones.

Keltner Channel for traders or young developers by William210

This Script collects all MQL5 built-in indicators buffers and stores them in a CSV file for analysis purposes

While manually adjusting the stop-loss of a single trade to match its open price is a relatively simple task, managing numerous positions individually can be cumbersome and time-intensive. The Titik Impas Breakeven script for MT4/MT5 streamlines this process, providing efficiency and convenience for traders dealing with multiple positions.

This is a first for MetaTrader 5. Now you can click on the chart to create price alerts.

Bollinger Bands with controllable outer band smoothing (post smoothing)

Prototype for data collection. Dummy buffers for the data window (for data collection purposes) for the hour of the day, and an additional buffer for the hour of the day. Comments the hour of the day.

This script was developed for displaying saved Strategy report from the Strategy Tester into a chart.

An MQL5 Expert Advisor that reacts to high-impact forex news events using the MQL5 Calendar. It identifies news related to inflation (CPI/PPI) and interest rate decisions, placing breakout trades with pending orders. Ideal for traders looking to automate news-based strategies. (This is just a starting point)

Trade Assistant MetaTrader indicator — a multi-timeframe indicator that is based on three standard indicators: Stochastic oscillator, RSI (Relative Strength Index), and CCI (Commodity Channel Index). It displays current trend directions for M1, M5, M15, M30, H1, H4, D1, W1, and MN1 timeframes. When you follow such an indicator you have a clear picture of the trends across all important timeframes. It doesn't matter which timeframe you attach this indicator to. The indicator can be downloaded for MT4 and MT5.

Custom time and price scale.

Draw daily vertical lines plus the day of week labels on the chart.

The T3 Indicator is an advanced moving average that combines six exponential moving averages to provide smoother price action with reduced lag compared to traditional moving averages.

This is a simple indicator to display histogram of custom bars' durations in minutes. Applicable for renko boxes, PnF, equivolume bars, etc.

1234567891011...191