Watch how to download trading robots for free
Find us on Telegram!
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 - 13

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

This EA uses indicators iCCI (Commodity Channel Index, CCI), ZigZag, and Impulse. Position trailing is possible.

The EA trades with the Absorption pattern. Working with pending orders Buy Stop and Sell Stop.

The EA trades on the iMA (Moving Average, MA) indicator. At the same time, there is a parameter of the indicator indent from price, set in percents.

Two Moving Average indicators: A slow one for opening positions, and a fast one for closing positions.

An Expert Advisor based on two indicators: iMAs (Moving Average, MA) and iMomentum (Momentum).

The FX-CHAOS_SCALP trading strategy.

The EA waits for the price to pass XXX points within NNN ticks.

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 consideration, i.e., whether it is a netting or a hedging one.

Small_Inside_Bar_Strategy - an Expert Advisor based on indicator Small_Inside_Bar.

ChannelEA2 - an Expert Advisor working in a channel, using pending stop orders.

No indicators: Only Open and Close price analysis. Input parameters: Stop Loss, Take Profit, and Trailing.

The EA uses indicators Pivot-2 and Heiken Ashi Smoothed Oscillator.

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

The Expert Advisor waits when the lines of MA(10), MA(20), MA(50), MA(100) and MA(200) get arranged one above the other (or one below the other).

An Expert Advisor based on a random number generator. Trend is determined using the iMA (Moving Average, MA) indicator.

The Expert Advisor trades using levels. It can have a maximum of two positions of each type (Buy and Sell) in the market.

A portfolio EA for the MOEX FORTS market.

A trading system based on the Donchian Channel indicator.

Universal trailing of positions and pending orders.

Crossover of two iMAs (Moving Averages), one more iMA (Moving Average) is used as the filter. Lot: manual or risk percent of balance. Stop, Market or Limit orders. The EA also sets Stop Loss, Take Profit, Trailing Stop.

Pending Buy Stop and Sell Stop orders. The EA trades in the specified time period. Determines the highest and lowest prices in the specified range of bars. Position trailing.

Signals are generated by the iBands, Bollinger Bands indicator. When a signal is received, opposite positions are closed.

ChannelEA1 - an Expert Advisor working in a channel, using pending limit orders

The Expert Advisor places a grid of pending Buy Stop and Sell Stop orders.

An Expert Advisor based on two iMAs (Moving Average,MA) and one iRSI (Relative Strength Index, RSI). It tracks virtual profit. Works on two symbols.

The Expert Advisor opens no more than one position per day. Positions are opened at the specified time. It searches for the Highest and Lowest price in an interval. Data of two iMA (Moving Average, MA) indicators are used.

A utility for applying trailing stop based on the "Parabolic SAR" indicator.

The Expert Advisor places pending Buy Stop and Sell Stop orders. Includes checks for the minimum distance of orders in points (SYMBOL_TRADE_STOPS_LEVEL).

Trend detection based on the last three bars.

An Expert Advisor based on two iMAs (Moving Average, MA) and one iSAR (Parabolic SAR). Position trailing.

The Expert Advisor opens positions when the price crosses line objects.

Simultaneous opening of two opposite positions. Trailing Stop.

Pending Buy Stop and Sell Stop orders. The EA trades in the specified time period. Determines the highest and lowest prices in the specified range of bars. Position trailing.

An Expert Advisor based on the iIchimoku (Ichimoku Kinko Hyo) indicator. Separate Stop Loss, Take Profit and Trailing Stop for BUY and SELL positions. The EA operation time is configurable. A check is performed on the current bar: only one position can be opened.

The EA trades using pending Buy Stop and Sell Stop orders, applying the iAMA (Adaptive Moving Average, AMA) indicator based on a "round price". Position trailing.

The Expert Advisor uses the Fractals indicator signals to place pending orders and trail the Stop Loss level of positions.

The Expert Advisor is based on a dynamic moving average.

The Expert Advisor opens positions inside two time intervals. Trades are closed at the specified time. Trailing Stop.

The Expert Advisor is based on 30 popular candlestick patterns.

The Expert Advisor uses three iMA (Moving Average, MA) indicators and one iMACD (Moving Average Convergence/Divergence, MACD)

1...67891011121314151617181920...36