Download MetaTrader 5

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

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.

latest|best

The simple script for deleting all graphical objects from a financial asset chart. It can be useful, in case the chart is overcrowded by objects that are not needed anymore.

XMACD_HTF_Signal displays trend directions from three last bars of the XMACD indicator as three graphical objects.

SpreadInfo displays current spread, its average value and their ratio in one of the chart corners.

X2MA_HTF_Signal displays trend directions from three last bars of the X2MA indicator as three graphical objects, colors of which determine a trend direction.

CMOOnArray class is designed for calculation of CMO (Chande Momentum Oscillator) values on indicator buffers. The example of use of the CMOOnArray class is presented.

Function module for more convenient font selection display in the indicator input parameters. To free the indicator user from the necessity to manually enter a font name some changes to the code should be inserted.

The moving average, calculated by using the simplest algebraic combination of two other moving averages with different periods. Smoothing algorithms can be selected out of ten possible versions.

CERDOnArray class is designed to calculate the Efficiency Ratio (ER) used in the Adaptive Moving Average (AMA) considering price movement direction. When the price is moving upwards the indicator has positive values, when it is moving downwards, - negative ones.

CEROnArray class is designed to calculate the Efficiency Ratio (ER) used in the Adaptive Moving Average (AMA). The example of use of the CEROnArray class is presented.

ZigZag based on fractals. Due to the use of Fractals indicator, it works much faster than conventional ZigZag indicator.

Good old stochastic oscillator. The difference from the standard one is that it shows overbought and oversold areas in a more visually convenient fashion.

Candlesticks length volatility indicator useful for tracking gaps on the market and having the settings analogous to the Bollinger Channel. The indicator can show flats and trend beginnings.

CMFIOnArray class is designed for calculation of MFI (Money Flow Index) values on indicator buffer. The example of use of the class is presented.

CRSIOnArray class is designed for calculation of RSI (Relative Strength Index, RSI) values on indicator buffers. The example of use of the class is presented.

The indicator shows the average percentage value of the last candlesticks overlap. It is useful for those, who enters the market manually using limit orders during price consolidation, as it allows to select order direction. Blue line - recommended BUY-LIMIT, red one - SELL-LIMIT.

Laguerre_HTF_Signal shows a trend direction or a signal for performing a deal generated by Laguerre indicator as a graphic object with colored trend indication or deal direction.

The script exports historical data to HST format for its use in MetaTrader 4 client terminal. This file can be imported in MetaTrader 4 as historical data or you can open it as offline chart.

CAMAOnArray class is designed for calculation of AMA (Adaptive Moving Average) values on indicator buffers. The example of use of the class is provided.

The indicator displays the inclined trend line that sets the signal actuating level.

The indicator is based on the description given in Joe DiNapoli book "Trading with DiNapoli Levels". It is designed to evaluate the actual market overbought/oversold states.

Vertical time grid with six hours step.

COsMAOnArray class is designed for calculation of OsMA (Moving Average of Oscillator) values on indicator buffers. The example of use of the class is provided.

The indicator transfers the price data to the new coordinates system associated with X2MA indicator values.

The candlesticks are colored in red, green and blue colors depending on a trend direction (Moving Average and MACD overall values).

The channel based on the price percentage deviation from the previous value of the channel middle line.

Nonlagdot is the supply and demand indicator that calculates a possible trend considering market forces domination.

Trend indicator. Trend reversal is calculated by the number of candlesticks set in the indicator input parameters.

The indicator displays colored candlesticks depending on the current trend and considering Fibonacci levels correction and also gives alerts or audio warnings in case of a trend change.

The indicator displays the crossing points of RSI (Relative Strength Index) indicators belonging to various periods.

CStochasticOnArray class is designed for calculation of Stochastic indicator values on indicator buffers. The example of use of the class is provided.

Trinity-Impulse indicator shows market entries and periods of flat.

Vertical time grid with three hours step.

The indicator displays the horizontal line that sets the signal actuating level.

Vertical time grid with eight hours step.

CMACDOnArray class is designed for calculation of MACD (Moving Average Convergence/Divergence) values on indicator buffers. The example of use of the class is provided.

Vertical time grid with four hours step.

The indicator builds a candlestick chart consisting of floating spread current values in online mode.

CADXWOnArray class is designed for calculation of ADXW (Average Directional Movement Index Wilder, ADX Wilder) values on indicator buffers. The example of use of the class is provided.

CADXOnArray class is designed for calculation of ADX (Average Directional Movement Index) values on indicator buffers. The example of use of the class is provided.

The indicator allows to work with changing in real time and mirror reversed (1/X) trading instrument.

1...838485868788899091929394959697...104