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

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

Stop loss and take profit initial setting. Trailing.

Trading system based on iADX (Average Directional Movement Index, ADX) and iAMA (Adaptive Moving Average, AMA) indicators. The system works on a new bar only.

The trading system is based on a simple neural network.

The Expert Advisor based on iBullsPower (Bulls Power) and iBearsPower (Bears Power) indicators.

Analyzing the price channel (iHighest, iLowest) for a certain period of bars.

The Expert Advisor based on ZigZag.

The Expert Advisor based on iCCI (Commodity Channel Index, CCI) indicator.

The Expert Advisor based on BrainTrend1Sig indicator

The trading system based on XDeMarker_Histogram_Vol indicator signals

Grid of pending orders. The EA applies iADX (Average Directional Movement Index, ADX) indicator.

The Expert Advisor based on iMACD(). Displaying MACD values via Point().

Working with Buy stop and Sell stop pending orders.

Grid of Stop and Limit pending orders.

The trading system based on the MA_Rounding_Candle indicator signals with an ability to change the volume of a forthcoming trade depending on the results of the previous trades for this trading system

Exp_XHullTrend_Digit is based on signals generated by XHullTrend_Digit indicator

The trading system based on SSL_NRTR indicator signals with the possibility to set a fixed position holding time

Trading based on three iMAs (Moving Average, MA)

A trading system using the XAng_Zad_C trend-following indicator with the possibility to set a fixed trading time interval and change the volume of a forthcoming trade depending on the results of the previous trades.

Checking a trading system: Close > Open → BUY signal, Close < Open → SELL signal.

A scalping Expert Advisor based on the "Market Capture" strategy.

An Expert Advisor based on iMA (Moving Average, MA) and iMomentum (Momentum).

A trading system based on the Trading_Channel_Index oscillator signals.

A trading system based on the Trend_Intensity_Index oscillator signals.

Three independent trading systems using ColorXPWMA_Digit indicators within a single EA with an ability to change the volume of a forthcoming trade depending on the results of the previous trades for this trading system

A trading system based on the UltraMFI indicator signals with an ability to change the volume of a forthcoming trade depending on the results of the previous trades for this trading system.

This Expert Advisor doesn't use any indicators. It only applies analysis of Close prices at bar #1 and the specified bar.

A trading system based on the FX Fish 2MA indicator.

An Expert Advisor based on iRSI (Relative Strength Index, RSI).

A trading system based on iMA (Moving Average, MA) with the averaging period of 55 (the averaging period is hardcoded and is not available in input parameters).

An Expert Advisor based on the iMA (Moving Average, MA) indicator.

One of the variations of the "Avalanche" strategy. Martingale is used.

A trading system based on the ColorXPWMA_Digit indicator signals with an ability to change the volume of a forthcoming trade depending on the results of the previous trades for this trading system.

An Expert Advisor based on the iWPR (Williams' Percent Range, %R) indicator with the operation time control.

The Expert Advisor utilizes the High and Low analysis, as well as one iMACD (Moving Average Convergence/Divergence, MACD) and two iMAs (Moving Average, MA).

An Expert Advisor based on the iIchimoku (Ichimoku Kinko Hyo) indicator.

Three independent trading systems using XWAMI indicators within a single EA with an ability to change the volume of a forthcoming trade depending on the results of the previous trades for this trading system.

Expert advisor uses the difference between bar closes and a close moving average to detect unusual activity, it will then buy arbitrary volatility spikes. This is a prototype that I will be expanding on in the future, at the moment the user can input an arbitrary level to buy at. In future developments I plan on building a neural network in the EA that detects and compares volatility levels.

Expert adviser scans past 500 closing bars and looks for common closing regions as entries.

Draw your horizontal and trendlines and be notified when price crosses them

Increasing a position volume. Entry signal by iDeMarker (DeMarker, DeM) indicator. Regular trailing and trailing by equity.

12345678910111213141516...36