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

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.


An indicator of bull/bear power.

Indicator Intraday Intensity Index 2

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

A market state indicator

Difference of two moving averages within the range of one-direction candlesticks

Two moving averages on the range of one-direction candlesticks

An indicator of bull/bear power

A configurable RSI

Indicator Average Average True Range

A channel formed by two moving averages AbsolutelyNoLagLwma based on averaged High and Low timeseries

Indicator Rj_SlidingRangeRj_Digit with the timeframe selection option available in the input parameters

Indicator Ang_Zad_C_Hist_Candle with the timeframe selection option available in the input parameters

Indicator Bear_Bulls_Power_Candle with the timeframe selection option available in the input parameters

Indicator Ang_Zad_C_Hist_Candle with the timeframe selection option available in the input parameters

Indicator Ang_Zad_C_Hist with the timeframe selection option available in the input parameters

Indicator Ang_Zad_C allowing changing the timeframe of the indicator in its input parameters, the space between the oscillator and its signal line being filled in color, according to the trend direction

The Expert Advisor uses indicator iBands (Bollinger Bands, BB), two iMAs (Moving Average, MA) from different timeframes, and custom indicator ZigZag.

An Expert Advisor based on indicator iADX (Average Directional Movement Index, ADX).

An Expert Advisor based on cluster indicator CCFp (Complex Common Frames percent)

JB Volatility - market volatility oscillator marking its state in color.

Indicator CRF (Cumulative Rotation Factor) displays the states of the market: Uptrends/downtrends/consolidation.

Indicator CMC (Clear Method Candles) displays colored candlesticks, based on the existing market trend. It is calculated by the "pure" method (without using any other indicators, only price) and has no configurable parameters. It is based on indicator Clear Method Histogram.

Indicator CMH (Clear Method Histogram) displays a color histogram of the current market trend.

Indicator VC (Volatility Channel by Larry Williams).

Oscillator TTF (Trend Trigger Factor) was developed as a method to identify market trends and reversals.

Oscillator TCF (Trend Continuation Factor) was developed to help identify the trend and direction of the market.

In pscillator Self-Adjusting RSI, we have implemented the methods of automated adjusting the RSI oscillator overbought/oversold levels, described in David Sepiashvili's article The Self-Adjusting RSI.

Indicator RP (Range Position) displays the price position within the range (from Low to High) reached over the previous N periods.

PAC (Periods After Crossing MA) is an oscillator displaying the number of bars elapsed after the last crossing of the price and the moving average.

Indicator showing the difference between the +DI and -DI of indicator ADX.

Buff Dormeier's moving average weighted by volume.

AV (Average Volatility) - a simple average volatility oscillator.

BOP (Balance of Power) is an oscillator that allows you to assess the powers of buyers and sellers on the market and identify the trend reversal within a proper time.

Oscillator Adaptable_CCI. Along with the calculation price and period, this indicator, unlike the standard one, allows you to change parameters, such as calculation range, correction coefficient, and smoothing method.

Indicator Zero Lag Triple Exponential Moving Average.

Indicator Tom_Demark_Moving_Average is the moving average based on Demark's statements regarding trend identification.

A simple indicator based on standard stochastic. Along with the Main and Signal lines of standard stochastic, it also draws a color histogram between these two lines.

Oscillator Slingshot displays in the chart the price momentum histogram and signal line. The probable direction of the fitire price movement is marked in the histogram with different colors.

Channel indicator Rj_SlidingRangeRj with the possibility to round the indicator levels to the required number of digits.

The indicator of probable market reversal based on the true bar value (True Value of Bar).