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 Codes of Expert Advisors for MetaTrader 5 - 14

icon

Expert Advisors analyze price charts and trade automatically following underlying rules. Here you can find MQL5 source codes solving a variety of problems. You are able to select both simple Expert Advisors based on moving average crossing and complex ones involving complicated signal generation algorithms and protection against trading mistakes.

You can download and launch offered Expert Advisors in MetaTrader 5. It is recommended that you test and optimize trading robots in the Strategy Tester before using them. The library of Expert Advisors is also available directly from MetaTrader 5 platform and MetaEditor development environment.

Submit your code

The Expert Advisor is based on a dynamic moving average.

The Expert Advisor opens positions inside two time intervals. Trades are closed at the specified time. Trailing Stop.

The Expert Advisor is based on 30 popular candlestick patterns.

The Expert Advisor uses three iMA (Moving Average, MA) indicators and one iMACD (Moving Average Convergence/Divergence, MACD)

The Expert Advisor searches for N identical candlesticks in a row. It buys on bullish candlesticks and sells on bearish ones. The account type is taken into account, i.e. whether it is netting or hedging.

The Expert Advisor works based on the iChaikin (Chaikin Oscillator) and iMA (Moving Average, MA) indicators.

An Expert Advisor trading MACD signals. For those who prefer trading CFDs and futures symbols.

An MQL5 implementation of the adaptive UmnickTrade Expert Advisor.

Trading in a channel based on a Moving Average with the period of 220 and three Envelopes with the periods of 220 and different heights. Position trailing.

A trading system based on the account balance and the result of the last trade.

Simple trailing of stop loss and take profit orders of open positions.

The EA trades using the signals of iADX (Average Directional Movement Index, ADX) and iSAR (Parabolic SAR) indicators. The profit/loss of the last closed position is taken into account. Positions are moved to breakeven.

A trading system based on three indicators: two iMAs (Moving Average) and iMACD (Moving Average Convergence/Divergence, MACD).

A trading system based on two indicators: iSAR (Parabolic SAR) and iRSI (Relative Strength Index, RSI). Lot calculation based on the risk value as a percentage of free margin.

The Expert Advisor uses Buy Stop and Sell Stop orders to trade news and large price movements.

Opening positions randomly after a certain time interval.

This non-trading Expert Advisor is designed for the simple trailing of take profit orders of open positions.

A Simple Expert Advisor The EA opens a position of the specified type at the time specified in the EA parameters. The position is closed at the time specified in the appropriate parameter.

Implementation of multiple trailing types. Pending Buy Stop and Sell Stop orders. Limitation of the maximum total lot and the total number of positions. Several types of position volume calculation.

An Expert Advisor, which trades in a channel based on the Percentage_Crossover_Channel indicator.

An Expert Advisor based on the Diff_TF_MA indicator.

An Expert Advisor based on the "Fractals at Close prices" indicator.

The Expert Advisor is based on the channel indicator Price_Extreme_Indicator.

It is a further development of the first VR---ZVER version. The new version features trailing stop, a separate flag for allowing/prohibiting BUY positions, a separate flag for allowing/prohibiting SELL positions.

An assistant EA for manual trading. Sets Stop loss, Take profit, moves positions to breakeven and applies trailing.

A trading system based on the ZigZag indicator.

A trading system based on ColorJJRSX indicator signals with the possibility to set a fixed position holding time.

Buy or Sell signals are generated when the price is above iMA (Miving Average, MA) with a very large period. As the number of open positions increases, the distance between trades (during which entry signals are skipped) also increases. The EA trades in the specified time interval.

A trading system based on ColorJFatl_Digit indicator signals with the possibility to set a fixed position holding time.

Two identical trading systems based on the change in the color of the XDidi_Index_Cloud indicator cloud for long and short trades, which can be configured in different ways in one Expert Advisor.

The Expert Advisor allows checking the potential profitability of the ZigZagLW Addition indicator.

An Expert Advisor based on the "Arrows&Curves" indicator.

Martingale based Expert Advisor specially designed for small deposits.

The Expert Advisor uses three iMAs (Moving Average, MA), one iOsMA (Moving Average of Oscillator and one iRVI (Relative Vigor Index, RVI). Trailing stop is based on the High/Low of earlier bars.

Two identical trading systems based on the change in the color of XFatlXSatlCloud for long and short trades, which can be configured in different ways in one Expert Advisor.

A trading system based on the 'EMAAngle' and 'Laguerre RSI with Laguerre filter' indicators.

A trading robot for performing arbitrage between EURGBP and its synthetic quotes (triangular arbitrage).

Usually most brokers do not provide M1 data over 3 months in MetaTrader 4, but they provide M1 data over 3 years in MT5. So we can use this tool to obtain the M1 data in MetaTrader 5 tester and save the data into .hst file for MetaTrader 4 backtesting.

This is an MQL5 version of the Expert Advisor described in the article "How to reduce trader's risks" (https://www.mql5.com/en/articles/4233).

Trading signals are generated based on a comparison of two trend indicators: iMA (Moving Average, MA) and iSAR (Parabolic SAR). The EA works on the zero bar, only one position can be open. Trailing stop is used.

1...789101112131415161718192021...36