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


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

The indicator that gives signals in round value of price

The indicator draws possible support and resistance lines considering the fractals clusters

A smoother stochastic from the book by Joe Dinapoli "Trading With DiNapoli Levels"

The set of dynamic support and resistance levels using the ATR indicator and Fibo levels.

An elastic, volume weighed Moving Average

The script imitates the One Cancel Other function for orders. When one order is triggered, the others are deleted.

The Expert Advisor is realized on the ADX_Cross_Hull_Style and UltraXMA indicators.


Comparing the speed of a binary or a ternary search

The market volume indicator whose main purpose is to filter false signals which occur in the side movement of the market.

This system, based on Momentum indicator, assumes that very strong price movements are determinant. It consists in riding the appearing tsunamis, for instance, an important US Nonfarm Payrolls release. HawaiianTsunamiSurfer works well on AUDUSD, USDJPY and EURUSD.

The script for manual trade: when achieving the limit price the script sets stop order and logs out

The Expert Advisor drawn on the principle of the semaphore, signal MBKAsctrend3 indicator.

The channel indicator that draws support and resistance lines.

The Fast Stochastic indicator is one of modifications of a popular stochastic oscillator.

A semaphore, arrow indicator drawn on the basis of the ADX technical indicator

The breakthrough trading system based on the signals of the TMA indicator

The mathematical indicator that operates on the principle of approximation of sinusoid waves and realizes visualization of Fourier series for currency pair quotes

The Universal Oscillator indicator can display Bears Power, Bulls Power, CCI, DeMarker, MACD, Momentum, RSI, Stochastic, William's Percent Range. Three modes of overbought / oversold levels: the constant, dynamic (MA), dynamic (Bollinger Bands). Three rendering mode: line, filling, histogram

The market volatility indicator

The trading system drawn on the basis of the signals of the SuperWoodiesCCI indicator

This indicator uses support vector machines to analyse indicator data and signal future trades. Buy trades are signalled by a green ‘up’ arrow with sell trades signalled by a red ‘down’ arrow.


Triangular Moving Average (TMA). The main weight goes for the average part of the price series. In fact, the Moving Average is a double smoothed simple Moving Average

The trend indicator with divergence histogram.

The typical trend indicator drawn on the basis of three Moving Averages.

Price impulse meter.

The indicator "The Trend Detection Index" is a changed TDI indicator.

This indicator was created by Edward Coppock in 1962. It displays the long term possibilities to buy or sell (in the original, only to buy).

The trading system based on the Beginner signal indicator.

A simple, semaphore indicator to open positions

Moving Average with the choice of TF.

The Expert Advisor with which Alexander Prishchenko (Crucian) participated in Automated Trading Championship 2012

The chart layout in X-points reversal

The indicator "collects" the information of a trend lines drawn on a current chart, displays the prices of lines in the last (forming) bar and also either gives signals, or sends alerts when price crosses the trend line upon trader choice

Sistema de negociação baseado no indicador ColorSchaffTrendCycle.

The SchaffTrendCycle oscillator performed as a color histogram.

The Expert Advisor drawn on the basis of the TrendEnvelopes semaphore, signal indicator

The indicator draws support/resistance lines and the trend lines in the chart

The Expert Advisor drawn on the basis of the signals of the StepSto_v1 stochastic oscillator

The Expert Advisor moves Stop Loss of the open position along the border of the channel built using CandleStop indicator

The class is designed for calculation the Fractals technical indicator (Fractals) using the algorithm of the ring buffer.