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

ChannelEA2 - an Expert Advisor working in a channel, using pending stop orders.

No indicators: Only Open and Close price analysis. Input parameters: Stop Loss, Take Profit, and Trailing.

The EA uses indicators Pivot-2 and Heiken Ashi Smoothed Oscillator.

EMA_WMA - Expert Advisor for MetaTrader 5. Intersection of two iMA (MA). Position trailing.

The Expert Advisor waits when the lines of MA(10), MA(20), MA(50), MA(100) and MA(200) get arranged one above the other (or one below the other).

An Expert Advisor based on a random number generator. Trend is determined using the iMA (Moving Average, MA) indicator.

The Expert Advisor trades using levels. It can have a maximum of two positions of each type (Buy and Sell) in the market.

A portfolio EA for the MOEX FORTS market.

A trading system based on the Donchian Channel indicator.

Universal trailing of positions and pending orders.

Crossover of two iMAs (Moving Averages), one more iMA (Moving Average) is used as the filter. Lot: manual or risk percent of balance. Stop, Market or Limit orders. The EA also sets Stop Loss, Take Profit, Trailing Stop.

Pending Buy Stop and Sell Stop orders. The EA trades in the specified time period. Determines the highest and lowest prices in the specified range of bars. Position trailing.

Signals are generated by the iBands, Bollinger Bands indicator. When a signal is received, opposite positions are closed.

ChannelEA1 - an Expert Advisor working in a channel, using pending limit orders

The Expert Advisor places a grid of pending Buy Stop and Sell Stop orders.

An Expert Advisor based on two iMAs (Moving Average,MA) and one iRSI (Relative Strength Index, RSI). It tracks virtual profit. Works on two symbols.

The Expert Advisor opens no more than one position per day. Positions are opened at the specified time. It searches for the Highest and Lowest price in an interval. Data of two iMA (Moving Average, MA) indicators are used.

A utility for applying trailing stop based on the "Parabolic SAR" indicator.

The Expert Advisor places pending Buy Stop and Sell Stop orders. Includes checks for the minimum distance of orders in points (SYMBOL_TRADE_STOPS_LEVEL).

Trend detection based on the last three bars.

An Expert Advisor based on two iMAs (Moving Average, MA) and one iSAR (Parabolic SAR). Position trailing.

The Expert Advisor opens positions when the price crosses line objects.

Simultaneous opening of two opposite positions. Trailing Stop.

Pending Buy Stop and Sell Stop orders. The EA trades in the specified time period. Determines the highest and lowest prices in the specified range of bars. Position trailing.

An Expert Advisor based on the iIchimoku (Ichimoku Kinko Hyo) indicator. Separate Stop Loss, Take Profit and Trailing Stop for BUY and SELL positions. The EA operation time is configurable. A check is performed on the current bar: only one position can be opened.

The EA trades using pending Buy Stop and Sell Stop orders, applying the iAMA (Adaptive Moving Average, AMA) indicator based on a "round price". Position trailing.

The Expert Advisor uses the Fractals indicator signals to place pending orders and trail the Stop Loss level of positions.

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).

1...789101112131415161718192021...37