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

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 Exp_Stochastic_Chaikins_Volatility Expert Advisor based on the Stochastic_Chaikins_Volatility indicator color change.

A semi-automated Expert Advisor which signals of breakouts of specified horizontal levels.

The EA searches for N identical candlesticks in a row. If the found candlesticks are bullish, it buys. I they are bearish, the EA sells.

The Expert Advisor trades inside a channel, reversing positions at the channel borders.

Trades based on the previous candlestick.

A list of all positions. An example of working with CPositionInfo.

The Expert Advisor is based on the indicator with the same name. Lot is calculated based on the risk value as a percentage of free margin.

The Expert Advisor closes all positions opened on the account, if the current server time has exceeded the time limit specified in the input variables.

The Expert Advisor closes all the current symbol positions opened on the account, if the current server time has exceeded the time limit specified in the input variables.

Hedge The Hedge Trader EA.

We look for N identical candles in a row. If the found candles bull - we buy, if bear - we sell.

Advisor on the signals of the indicators Bollinger Bands and Moving Average.

Strategy: N bars up and one bar down. Trailing. Lot calculation based on the risk value as a percentage of free margin.

Intraday volatility breakthrough system. The Parabolic SAR indicator is used.

A trade strategy based on the RSI indicator. Checks if there is enough money before opening a position.

A trading system using the SSL indicator.

The EA uses two Moving Averages, one MACD and one CCI. OnTradeTransaction is used to receive position opening time.

Averaging of values (RSI) using MovingAverages.mqh. Two MA indicators.

An Expert Advisor based on the "RPoint" indicator. The chart layout in X-points reversal. A high-quality ZigZag based on HiLo.

The "Nevalyashka" Expert Advisor.

The implementation of the MACD pattern "Trend continuation".

A multi-currency Expert Advisor that opens a market position at the user defined time.

The Expert Advisor trades based on the ADX Wilder and Ichimoku Kinko Hyo indicators. Lot is calculated based on risk percentage of margin.

Trailing, pending orders. Signals of two indicators (Moving Average, MA). Trades only during a certain period of the day.

Trade direction is chosen based on a random number generator. Stop Loss and Take Profit are set based on the random number generator. Lot calculation based on the risk value as a percentage of free margin. The code contains protection against the "not enough money" error.

EMA

Intersection of two Moving Averages. Take Profit and Stop Loss levels are virtual.

Trading system based on the signals of the ICHI_OSC indicator

Lot calculation based on the risk value as a percentage of free margin.

Trading system based on the signals of the ThreeCandles indicator

The Exp_IBS_RSI_CCI_v4_X2 trend-following trading system is based on the signals of two IBS_RSI_CCI_v4 indicators.

The Exp_XOSignal_ReOpen trading system based on the signals of the XOSignal indicator with trend following scaling

The Exp_CGOscillator_X2 trend trading system based on the signals from two CGOscillator indicators.

The Exp_ttm-trend_ReOpen trading system based on the signals of the ttm-trend indicator with trend following scaling.

Crossing of the two iMAs. Lot calculation based on the risk value as a percentage of margin.

The Exp_ChandelExitSign_ReOpen trading system based on the signals of the ChandelExitSign indicator with trend following scaling.

An example of determining the moment when a pending order has triggered.

The Expert Advisor opens a deal in the breakout direction. Lot calculation depending on risk percent of margin.

An ExpertAdvisor based on the T3MA-ALARM indicator.

Support\resistance levels, trend direction — bullish\bearish.

The Expert Advisor increases the lot size after each of profitable deal, if it was preceded by losing trades. Martingale.

1...111213141516171819202122232425...36