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

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

Trade signals based on "Bullish Harami/Bearish Harami" candlestick pattern, confirmed by Market Facilitation Index (MFI) indicator is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

Trade signals based on "Bullish Harami/Bearish Harami" candlestick pattern, confirmed by Commodity Channel Index (CCI) indicator is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

Trade signals based on "Bullish Harami/Bearish Harami" candlestick pattern, confirmed by Stochastic indicator is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

Trade signals based on "Bullish Engulfing/Bearish Engulfing" candlestick pattern, confirmed by Relative Strength Index (RSI) indicator is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

Trade signals based on "Bullish Engulfing/Bearish Engulfing" candlestick pattern, confirmed by Market Facilitation Index (MFI) indicator is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

Trade signals based on "Bullish Engulfing/Bearish Engulfing" candlestick pattern, confirmed by Commodity Channel Index (CCI) indicator is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

Trade signals based on "Bullish Engulfing/Bearish Engulfing" candlestick pattern, confirmed by Stochastic indicator is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

The CDownLoadHistory class provides the methods of historical data downloading.

The script contains a class, that can be used to solve mathematical and logical expressions, defined as string.

The script downloads historical data (for the current symbol), available at trade server.

Trade signals based on "Dark Cloud Cover/Piercing Line" candlestick pattern, confirmed by Relative Strength Index (RSI) indicator is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

Trade signals based on "Dark Cloud Cover/Piercing Line" candlestick pattern, confirmed by Market Facilitation Index (MFI) indicator is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

Trade signals based on "Dark Cloud Cover/Piercing Line" candlestick pattern, confirmed by Commodity Channel Index (CCI) indicator is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

Trade signals based on "Dark Cloud Cover/Piercing Line" candlestick pattern, confirmed by Stochastic indicator is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

Simple script with demonstration of use of the ChartNavigate() function.

Simple example of use of the DRAW_ZIGZAG drawing style.

Trade signals based on "3 Black Crows/3 White Soldiers" candlestick pattern, confirmed by Relative Strength Index (RSI) indicator is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

Trade signals based on "3 Black Crows/3 White Soldiers" candlestick pattern, confirmed by Market Facilitation Index (MFI) indicator is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

Trade signals based on "3 Black Crows/3 White Soldiers" candlestick pattern, confirmed by Commodity Channel Index (CCI) indicator is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

It speaks the specified text using the speech engine.

The class can be used for creation of trade signal classes with reversal candlestick patterns.

Trade signals based on "3 Black Crows/3 White Soldiers" candlestick pattern, confirmed by Stochastic indicator is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

The example of use of the resources. It creates a button, using the object of OBJ_BITMAP_LABEL type.

The example of chart background image, created using the object of OBJ_BITMAP type.

The example of button, created using the object of OBJ_BITMAP_LABEL type.

A class for creation and output of BMP images.

The Trend Magic indicator.

The Expert Advisor allows to trade using the keyboard.

This is the simplified implementation of multicurrency mode in MetaTrader 5. It isn't necessary to consider the details how does it work. It has minimum settings and simple structure. It can be used in Strategy Tester.

Nonparametric zigzag. The monotonicity condition for the ascending segment of the zigzag: the High of the any subsequent bar should not be lower than any Low of the ascending segment.

Nonparametric ZigZag, based on the "a-la Clyde Lee Patterns".

The Expert Advisor uses the Moving Average and Stochastic indicators.

The library contains the following hash functions: adler32, CRC-32, MaHash8v64. Also it has functions for radix conversion of a number.

This Expert Advisor performs the synchronization of charts.

This script exports indicator's values to CSV file.

This indicator will allow you to perform the recalculation of the indicator's data only when the new bar on the chart has appeared.

Trade signals based on reversal candlestick patterns is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

New version of the sChartsSynchroScroll script.

The improved version of the ZigZag indicator.

Trade signals based on crossover of lines of the Alligator technical indicator is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

1...129130131132133134135136137138139140141