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

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 trades based on the i-Regr indicator signals.

The МТ45 Expert Advisor is based on the Martingale strategy. It is designed for trading in the МetaТrader 4 and МetaТrader 5 terminals.

The Expert Advisor trades using the signals of the following indicators: iStdDev (two indicators), iMACD, iCCI, iATR. Moving positions to breakeven.

Opening and closing positions at a specified time.

The Expert Advisor sets pending Buy Stop and Sell Stop order at a specified time.

An expert advisor based on the TRIX ARROWS indicator.

The Expert Advisor sets a grid of pending Sell Limit and Buy Limit orders.

The Expert Advisor uses Burg's method for linear prediction.

A trading system based on the Stopreversal indicator signals.

Opening a position opposite to the closed one. Trades are processed in the OnTradeTransaction function.

Candlestick size analysis. The idea of the trading system: candlestick parameters matter after news releases.

Trading based on a random number generator or in one of the following sequences: BUY - SELL - BUY or SELL - BUY - SELL.

This assistant tool sets Stop Loss and Take Profit for all open orders. Symbol settings, position type, Stop Loss and Take Profit are specified in an external file.

The strategy is based on the ZigZag indicator and pending orders.

We open a new position opposite to the previous one. Inputs only contain Stop loss, Take Profit and the minimum lot.

The OzFx system. It uses Accelerator Oscillator and Stochastic Oscillator.

The Price Channel trading system.

A trading system based on the ForceTrend indicator signals.

An Expert Advisor without a single indicator. Uses lot and step increase.

A trading system based on the ColorFisher_m11 indicator signals.

A trading system based on the AFStar indicator signals.

The iMA (Moving Average) indicator based on iCCI (Commodity Channel Index). It is an analogue of Previous Indicator's Data in the terminal.

If a trade is closed by Stop loss, the volume is doubled; if by Take profit the minimum volume is used. OnTradeTransaction is used to determine whether a trade was performed after the activation of Stop loss or Take profit.

Buy a security (open BUY positions) at a lower price, sell (open SELL positions) at a higher price.

A trading system based on the Omni_Trend indicator signals.

A breakout trading system based on the signals of the Color_PEMA_Envelopes_Digit_System indicator.

A breakout trading system based on the signals of the Color_QEMA_Envelopes_Digit_System indicator.

Buy a security (open BUY positions) at a lower price, sell (open SELL positions) at a higher price.

This utility program records tick quotes in the CSV and BIN format. A flexible set of symbols is available for writing.

Trades on PERIOD_M1 (M1). Calculates bullish and bearish candlesticks.

Closing all open positions with the specified profit percent.

The EA trades during two trading sessions, starting at the specified session beginning time. Stop Loss. Take Profit.

An assistant Expert Advisor. Only CLOSING positions.

The Expert Advisor uses three indicators: MA(150), RSI(3) with levels 80 and 20, Stochastic(6, 3, 3) with levels 70 and 30.

The EA uses the following indicators: CCI, fast and slow MA, Larry Williams' WPR.

Trading strategy: the breakout of a High/Low in the selected time interval.

Two ZigZag indicators are used for analysis.

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 trades based on signals generated by Stochastic Oscillator. Averaging. A limited number of positions. Trailing.

A simple system based on the crossover of two MAs.

1...91011121314151617181920212223...36