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

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

Comparing open prices of the zero and third bar.

The EA works based on the analysis of Open, High and Low.

An example of an Expert Advisor with a Trailing Stop implementation.

The EA places pending stop orders BUY_STOP and SELL_STOP.

The Expert Advisor places two pending orders (BuyStop and SellStop) with the specified expiration.

The Expert Advisor uses the values of two iMA (Moving Average, MA) indicators.

Uses two iStochastic (Stochastic Oscillator) indicators and one iRSI (RSI, Relative Strength Index). Calculates the lot size based on the analysis of closed trades.

The Expert Advisor searches for the momentum: iClose(t2)-iClose(t1).

The Expert Advisor opens or closes positions at the intersection of lines.

The Expert Advisor uses Parabolic SAR and three EMAs (with the periods of 10, 25 and 50).

Four trading strategies in one Expert Advisor.

The Expert Advisor plays sound alerts when candlestick size exceeds a certain value.

An example for calculating the lot value in accordance with the risk per trade.

The Expert Advisor trades moving average breakouts. It uses the following indicators: two iMAs (Moving Average, MA), iRSI(Relative Strength Index, RSI) and two iEnvelopes (Envelopes).

Trades using indicators: iStochastic (Stochastic Oscillator) and iRSI (Relative Strength Index, RSI).

The creation of the Expert Advisor stems from the topic "Neural networks - where to start studying them".

The Expert Advisor uses the iBullsPower (Bulls Power) indicator.

The Expert Advisor uses the iDeMarker (DeMarker, DeM) and iStochastic (Stochastic Oscillator) indicators. Three virtual levels to protect profit.

The Expert Advisor trades the High and Low breakouts of the previous day.

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

The Expert Advisor searches for movements without rollbacks (analysis of ticks).

Alligator - Expert Advisor for MetaTrader 5. Trading based on indicators: iAlligator (Alligator), iFractals (Fractals). Martingale.

Straddle&Trail - Expert Advisor for MetaTrader 5.

MTC Neural network plus MACD - Expert Advisor for MetaTrader 5.

MacdPatternTraderAll - Expert Advisor for MetaTrader 5. Six (iMACD, MACD, Moving Average Convergence/Divergence) indicators and four (iMA, MA, Moving Average) indicators. Opens trades when the indicator's MACD crosses its signal line.

Expert Advisor inspired by Ilan 1.6. It uses the iCCI(CCI, Commodity Channel Index), iRSI(RSI, Relative Strength Index) indicators.

The simplest EA based on the fractal MFI.

Trading based on two indicators: iAlligator (Alligator).

Works based on two indicators: iCCI (Commodity Channel Index, CCI) and iMACD (Moving Average Convergence/Divergence, MACD). OnTradeTransaction().

Trading based on the ZeroLag MACD custom indicator.

The Expert Advisor based on the iAlligator (Alligator), iMA (Moving Average) indicators.

The Expert Advisor works in martingale mode based on the signals of iStochastic (Stochastic Oscillator).

The Expert Advisor uses signals from the indicators: ATR, MACD.

Increasing the lot after a losing trade. Entry signals are based on the DeMarker indicator.

The simplest EA based on the WeightOscillator weighted oscillator.

Ilan1.4 - Expert Advisor for MetaTrader 5.

The Exp_SilverTrend_Signal_ReOpen trading system based on the signals of the SilverTrend_Signal indicator with scaling by the trend.

The Exp_BykovTrend_ReOpen trading system based on the signals of the BykovTrend indicator with scaling by the trend.

The Expert Advisor trades daily breakouts. It places pending BuyStop and SellStop orders.

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

1...131415161718192021222324252627...36