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

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 places four positions with different Take Profit levels per time. As soon as one Take Profit triggers, the other positions will be moved to breakeven.

Candlestick size and shadow analysis. In OnTradeTransaction, opening (DEAL_ENTRY_IN) and closing (DEAL_ENTRY_OUT) the positions are intercepted, as well as closing by Stop loss (DEAL_REASON_SL).

An unorthodox approach to indicator MACD: The EA calculates the indicator's area displayed above and below zero line.

A trading system based on object Fibonacci Lines (OBJ_FIBO) and on indicator Resistance & Support

Trend-following trading system Exp_XPeriodCandle_X2 is based on the signals of two indicators: XPeriodCandle and XPeriodCandle_HTF.

A trading system based on the signals of indicator XPeriodCandle.

A trading system based on the signals of indicator CaudateXPeriodCandle, enabling to maintain your positions within a fixed period of time.

A trend-following trading system Exp_WAMI_Cloud_X2 based on the sisgnals of two indicators WAMI.

An Expert Advisor based on iFractals (Fractals) and on custom indicator ExVol.

A trading system based on the signals of indicator ColorXDerivative.

A trading system based on the tick volume of bars.

A trading system using oscillator UltraAbsolutelyNoLagLwma.

A trading strategy based on indicators iBands (Bollinger Bands, BB) and iRSI (Relative Strength Index, RSI).

Expert Advisor Exp_BlauTVI_Tm based on the signals of trend-following indicator BlauTVI

A trading system using oscillator BlauErgodicMDI with the option of strictly setting a trading time interval

Trend-following trading system Exp_ColorX2MA_X2 based on the signals of two indicators ColorX2MA

An Expert Advisor based on indicator Renko Level

Trend-following trading system Exp_AbsolutelyNoLagLwma_X2 based on the signals of two indicators AbsolutelyNoLagLwma

Moving averages on charts M5, M15, H1 are analyzed. The presence of the iMA (Moving Average, MA) "fan" is checked simultaneously on all three charts (M5, M15, and H1).

This utility tracks positions opened manually or by another EA for the current symbol and opens an opposite position. Opening the positions is tracked in OnTradeTransaction.

A trading system that only trades on resverse and from Thursday to Friday only.

An Expert Advisor based on two indicators iMA (Moving Average, MA). At crossing, we move back from the price at a certain distance and then expect the level obtained to be broken through.

Working with indicator iMA (Moving Average, MA) with a rigidly defined timeframe: D1.

iMACD (Moving Average Convergence/Divergence, MACD) with adjustable timeframes and a Stochastic of the current timeframe.

An Expert Advisor based on two indicators iMA (Moving Average, MA).

A trend-following trading system Exp_Sinewave2_X2 is based on the signals of two indicators Sinewave2

Two identical trading systems (for long and short positions) based on the signals of indicator SilverTrend, which can be configured in different ways within one Expert Advisor.

The Exp_CandlesticksBW_Tm Expert Advisor is based on the color change of the CandlesticksBW candlesticks and allows strictly define the trading time interval.

Two indicators iMA (Moving Average, MA) and one iRSI (Relative Strength Index, RSI). Many settings and optimization of trade signals formula.

A trading system based on the signals of indicator SilverTrend_CrazyChart.

Trading based on indicator iStochastic (Stochastic Oscillator, Stochastic). Stop Loss, Take Profit, and Trailing of a position can be enabled/disabled.

The EA closes all positions if the equity reaches a certain ratio as related to the balance.

Expert Advisor "Previous Candle Breakdown."

The EA opens positions at crossing fast iMA and slow iMA (Moving Average, MA). It has the function of outstaying the losses. It catches the type of the position in OnTradeTransaction.

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

Trading panel based on class CDialog.

A slightly modified EA from the standard delivery: MQL5\Experts\Examples\Moving Average\Moving Average

Working with pending orders Buy Stop and Sell Stop. A channel of two indicators iMA (Moving Average, MA).

Positions are opened pseudorandomly. In case of loss (closing by Stop Loss and negative profit), Martingale is applied.

A trading system based on the signales of indicator ATR_Normalize_Histogram

1...456789101112131415161718...36