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

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

DLL (MS VC++ 2010) for working with Memory Mapped files.

This Expert Advisor is example of use of the Memory Mapping DLL for working with File Mapping functions. In this example the Expert Advisor create a virtual (memory-mapped) file and start to update the quotes on symbol. Using this way, Expert Advisors can exchange data (for example, quotes) using common memory-mapped file.

CRVIOnArray class is designed for calculation of RVI (Relative Vigor Index) values on indicator buffers. Test_RVIOnArray indicator is provided as the example of the class use.

Script for the charts simultaneous scrolling.

ElderImpulseSystem_HTF_Signal displays trend directions from the last bars of the ElderImpulseSystem as a sequence of graphical objects. The number of bars to be used is set in the input parameters.

CCHOOnArray class is designed for calculation of Chaikin Oscillator (CHO) values on indicator buffers. Test_CHOOnArray indicator is provided as the example of the class use.

The indicator shows the first, second and third quartiles of the sample.

The fan of hundred XMA moving averages with the possibility to change the number of lines on a chart and select a smoothing method out of ten possible versions.

CADOnArray class is designed for calculation of AD (Accumulation Distribution, A/D) values on indicator buffers. Test_ADOnArray indicator is provided as the example of the class use.

Guppy Multiple Moving Average (GMMA) is an indicator based on the relationships between groups of moving averages providing insight into the behavior of two dominant market groups - traders and investors.

Parabolic_HTF_Signal shows a trend direction or a signal for performing a deal generated by Color_Parabolic indicator at the chosen bar as a graphic object with colored trend indication or deal direction and sends alerts or audio signals in case of a market entry moment.

CMomentumOnArray class is designed for calculation of Momentum values on indicator buffers. Test_MomentumOnArray indicator is provided as the example of the class use.

The Binary Wave returns a positive or a negative value depending on how the indicator readings are interpreted.

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

CSAROnArray class is designed for calculation of SAR (Parabolic SAR) values on indicator buffers. The example of use of the CSAROnArray class is presented.

The indicator draws a grid of eight stochastic oscillators on one chart with the possibility to change the number of displayed lines.

StepXCCX_HTF_Signal displays trend directions from three last bars of the ColorStepXCCX indicator as three graphical objects with a trend color indication.

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.

1...120121122123124125126127128129130131132133134...141