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

Submit your code

Horizontal Grid Controller with KeyEvents

This Expert Advisor monitors the Stochastic oscillator to automatically close positions based on user-selected conditions: crossovers above overbought or below oversold, entry into overbought/oversold zones, or exit from those zones. Positions are filtered for closure by profit state (loss, profit, or both). An optional Test Mode enables basic entry signals when the %D line crosses configurable offset levels around the midline (50).

Set TakeProfit by just dragging and dropping script on the desired price level.

Keltner Channel for traders or young developers by William210

The MT5 custom indicator, named "wd.Multi_LineMA.mq5," is designed to offer traders valuable insights into Moving Average values from a higher timeframe (MTF Multi TimeFrame). It encompasses additional visual features for in-depth analysis, such as the ability to view trails for a specified number of bars and a dynamic MA horizontal price line.

Structure of input parameters

This EA is a demonstration of how you can implement your own Hedging strategy with the help of the include file.

main point is changing of MA curve to horizontal line and DPO curve shall represent to distance from close price to zero level or MA curve

Synchronized custom crosshair indicator showing price and (server/local) time.

Time-related functions for empirical detection of server time zone and daylight savings mode (DST) from history of quotes

This code provides a simple function for sending push notifications to your mobile device whenever trades are opened or closed in MetaTrader 5. It's designed for netting accounts (where only one position per symbol is allowed).

this is a copier template

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.

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.

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.

Indicator for calculating the average price of open positions, you can use the magic number if you want to separate the positions of just one robot, but the zero number is for manual operations.

This is a simple analytical (non-signal, one-time calculated) indicator that allows you to test the hypothesis that price timeseries represent a "random walk", specifically Gaussian "random walk". This can help to construct a parametric transformation of price increments into evenly distributed, more stable and predictable time series, at least in terms of volatility.

EquiPeak Drawdown Tracker is an indicator designed to monitor and record the maximum drawdown of your trading account in real time. It is not just an alerter of current drawdown; it is especially useful for visually comparing your current drawdown with the maximum historical drawdown you expect or have previously recorded.

This is a custom indicator for MetaTrader 5 whose sole purpose is to display a BMP image on the chart, centred on the screen

Custom MACD for MetaTrader 5 enhances the classic MACD with real-time signal alerts sent to your phone. Detect trends and reversals with customizable parameters, intuitive visuals, and automated buy/sell notifications.

This is a simple script file to compute lot size either using risk percentage approach or the actual amount to risk.

An indicator that provides a clear visualization of volume pressure on each side of the market

Expert Advisor for MetaTrader 5 that combines Exponential Moving Averages (EMA) and Relative Strength Index (RSI) to generate trading signals. Includes risk management features and trading time filter.

CloseAllOrders is a powerful and user-friendly Expert Advisor designed to simplify trade management in MetaTrader 5. With an intuitive button interface directly on your chart, you can close all market positions and pending orders instantly with just one click.

A candlestick chart which connects the ask price and bid price to the high and low of the candles

It's the classic zigzag with a timeframe input to display a HTF zigzag on a LTF chart

It signals a period of low market volatility that is about to end, foreshadowing a significant price move.

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.

WPR indicator in chart window with TPSL

Find Perfect Timeframe to trade

A clean, lightweight, and non-repainting indicator that automatically detects and draws Smart Money Concepts (SMC) Fair Value Gaps (FVG) directly on your chart across any timeframe.

Educational MT5 chart utility that monitors XAUUSD spread on the chart and alerts when spread rises above user-defined warning or danger levels.

SMC chart indicator: market structure (BOS/CHoCH), volume weighted order blocks, multi timeframe FVG, equal highs/lows, liquidity sweeps, premium/discount zones, a 3 time frame bias panel and an optional trade setup readout. Closed bar logic only (no repaint). It draws and alerts, it does not place trades.

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

Automatically draws support/resistance trendlines using 2 pivot detection algorithms. Features real-time breakout detection, auto-adjustment after breaks, historical line display, and comprehensive alerts. Note: This code is developed based on the original work by Rone (Copyright 2012), optimized in 2025.

A class for reading and writing individual bits or bit sequences to and from a buffer.

An indicator to detect and mark all popular candle patterns

Indicator displays the value of defined stop loss and or take profit in the deposit currency. Note: It calculates an estimated value based on a simple calculation and does not take into account brokerage commissions.

12345678910111213141516...205