Watch how to download trading robots for free
Find us on Twitter!
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 - 61


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

Oscillator RTR (Range To Range) shows the ratio of two ATRs, a fast one and a slow one. Indicator RTR (Range To Range)

Indicator ASCtrend with the NRTR line of possible stop order locations.

The indicator of the lowest tops and the highest bottoms.

Direction Filter Indicator.


Oscillator MIT (Momentum In Time) is a normal momentum with anchoring the calculations to the calculation start time.

Linda's Coil - an indicator of "engulfed" candlesticks.

Glitch_Index - indicator of the price deviation from its average value.

GAPO (Gopalakrishnan Range Index Oscillator) assesses quantitatively the volatility of an instrument, based on the trading range logarithm over an N-day period of time.

Oscillator ERVI (Ehlers' Relative Vigor Index) based on the relative vigor index by John F. Ehlers.


Indicator ESM (Elsig's Shifting Mean) shows the averaged shift of price over the specified time interval (bars).

Indicator ADL (Advances/Declines Line) shows the ratio of positive and negative price increments over a specified time interval.

A trading system based on the AbsolutelyNoLagLwma indicator signals.

Indicator AnchoredMomentum with the timeframe selection option available in input parameters.

The inverted chart of the current financial instrument.

Indicator ADX_Cross_Hull_Style_NRTR with the timeframe selection option available in input parameters.

Locking positions - opening Buy and Sell simultaneously.

An automated trading system with a data panel in form of the OBJ_LABEL objects.

An NRTR-type indicator using Average Directional Movement Index.

Indicator AbsolutelyNoLagLwma with the timeframe selection option available in input parameters, alerting when the indicator changes its color.

This oscillator shows the differences in points between the successive High of bars/candlesticks and Low of bars/candlesticks. It also shows them in different colors, depending on the directions and amount of points set in the properties.

A moving average using double LWMA-averaging and implemented in color.

Dynamic managing the lot size depending on the balance.

A semaphore signal indicator using the algorithm of indicator 2XMA_Ichimoku_Oscillator.

A trading system based on indicator iBands (Bollinger Bands, BB). Placing pending Buy Stop and Sell Stop within a specified time interval (from XX o'clock to YY o'clock).

A trading system based on the signals of indicator AverageChangeCandle.

Indicator XStdDevSpeed_direction shows the information on the market volatility, using the values of indicator XStdDevSpeed with a fixed timeframe.

A trading system based on the XRSIDeMarker_Histogram indicator signals.

A trading system based on the 2XMA_Ichimoku_Oscilator indicator signals.

Indicator EMAVFS_StDev with the timeframe selection option available in input parameters.

The indicator plots four horizontal lines: Two basic ones (red by default) above the High and below the Low of the "Bar number" bar and help lines (green by default) shifted from the basic ones.


The Expert Advisor does not use any indicators. It only uses the current price and the OHLC of zero bar.

The EMAVFS indicator with additional trend strength indication using colored dots based on the standard deviation algorithm.

A utility for closing (reducing the right side of the length) the rectangles, trendlines, or lines with arrows to some bars/candlesticks.

Indicator EMAVFS_channel with the timeframe selection option available in input parameters.

The trading system is based on a simple neural network.

Indicator EMAVFS with the timeframe selection option available in input parameters.

A channel using a non-smooth and steady approximation error, in which the exponential moving average with a variable smoothing factor is used as the midline.

The EA determines the overbought (OB) and oversold (OS) zones, for which it generates trading signals for selling or buying.

Indicator StopLoss Calculator.


Indicator Trend Quality.