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

MQL5 Source Code Library for MetaTrader 5 - 20

icon

This is the largest free source code library for MetaTrader 5 platform programs. Here you can find ready-made Expert Advisors, technical indicators, scripts and libraries. Use the code library when learning MQL5 language and develop your own automated trading applications based on the provided codes.

You can freely download and test published codes, as well as launch them in MetaTrader 5. The library is also available directly from MetaTrader 5 platform and MetaEditor development environment.

Submit your code

T3 velocity tape

Detect bullish and bearish engulfing candles when entering the overbought or oversold territory. We have all seen a currency pair enter the overbought or oversold territory and stay there for long periods of time. What this indicator does is gives you the emphasis. So if you are looking for reversals then you may want to take notice when oversold territory is entered into with a bullish engulfing candle or if the trend is your thing then check for bearish engulfing candles while entering oversold.

CCI - double smoothed Wilder's EMA filtered with floating levels

CCI - double smoothed Wilder's EMA filtered

This script will export the trade history from MT5 selected between two dates. The resulting file is CSV that can be opened/imported with any spreadsheet software. Current version 1.0 does not add the takeprofit and stoploss. Any advice to improve this is welcomed.

Bollinger bands breakout

Bollinger bands - extended

Export history of deals from MT5 retail hedging account selected between two dates. The resulting file is CSV that can be opened/imported with any spreadsheet software.

Simple harmonic oscillator

Simple harmonic index

Wave period oscillator

RMA - multi time frame version

M-oscillator extended

M-oscillator

RMA

RMA average

Kalman filter velocity

Double smoothed EMA - floating levels (multi time frame)

Double smoothed EMA - floating levels

Double smoothed EMA - multi time frame version

A trading system based on custom indicator VHF.

Expert Advisor Exp_SpearmanRankCorrelation_Histogram with the added option of trading within the weekly range only, the borders of which are specified in the EA's input settings

The indicator builds graphical object Fibonacci Levels with many settings at High and Low prices over the period specified in the indicator input parameters

A trading system with a very simple neural network unit. It uses an iMA (Moving Average, MA) on H1, H4, and D1.

Searching for a daily range. We use OBJ_HLINE, OBJ_VLINE.

The script builds the Fibonacci Levels graphical object with the option of selecting the number of its segments

Indicator CandlesAutoFibo_Grand with the option of changing the number of segments in the graphical object of Fibo levels using one input parameter

An Expert Advisor based on indicators iADX (Average Directional Movement Index, ADX) and iMACD (Moving Average Convergence/Divergence, MACD)

A script for automatically drawing the levels of the intraday High/Low on the FORTS trading session. There is also an option to draw the levels of the night High/Low prices (if the latter ones are beyond the intraday ones)

The market maker robot for trading futures and swap cryptocurrency contracts

Indicator CandlesAutoFibo with a wider range of settings to display Fibo levels.

A trading system based on indicator iMA (Moving Average, MA).

Three PEMAs from three different timeframes on a single chart

A colored cloud made of two PEMAs from different timeframes on a single chart.

Displaying the latest closed values of indicator Bollinger Bands® with colored rectangles and background filling

The EA uses two indicators iMA (Moving Average, MA), Fast and Slow, and one indicator iBands (Bollinger Bands, BB).

Signal (Alert) at crossing horizontal line by the price

The HLCrossSigForDeMarker is considered as a trend indicator since it is intended for "catching" trends. However, it's a pretty complex and informative indicator that allows excluding the psychological and emotional effects from trading.

Indicator XXDPO_Candle_Alerts with the timeframe selection option in its input parameters

Indicator XXDPO_Candle with the timeframe selection option in its input parameters

Indicator XXDPO_Candle can provide alerts and send email and push notifications when trading signals occur. Possible signal options

1...131415161718192021222324252627...183