Download MetaTrader 5

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 Code Library for MetaTrader 5 - 14

This is the largest free source code library for MetaTrader 5 platform programs. Here you can find ready-made Expert Advisors, technical indicators, scripts and libraries. Use the code library when learning MQL5 language and develop your own automated trading applications based on the provided codes.

You can freely download and test published codes, as well as launch them in MetaTrader 5. The library is also available directly from MetaTrader 5 platform and MetaEditor development environment.

latest|best

The Expert Advisor opens and closes at a certain time comparing two iMA indicators having different periods. A trade having a specified volume is opened at a specified symbol. Setting Stop Loss and Take Profit. Select position type: Buy or Sell.

The Exp_Bezier_ReOpen trading system is based on the Bezier indicator color change with adding to trend-following positions.

The EnvelopesATR_Cloud indicator with the timeframe selection option available in the input parameters.

This is a modified Bollinger Bands® displaying the upper and lower borders of the price deviation from МА calculated considering the average volatility of the symbol according to ATR indicator.

The Expert Advisor is based on moving averages crossing.

The Yaanna indicator with the timeframe selection option available in the input parameters.

This is a modified Envelopes indicator for measuring the price deviation. It displays the upper and lower borders of the price deviation from МА calculated considering the average volatility of the symbol according to ATR indicator.

Standard CCI oscillator implemented as a histogram rounding its values to the standard range.

The Exp_ColorJFatl_Digit_ReOpen trading system is based on the ColorJFatl_Digit indicator color change with adding to trend-following positions.

The Expert Advisor opens an initial position in the current candle's direction and increases its volume if profit in points increases a threshold fixed in the EA inputs.

The simplest Expert Advisor based on WPR.

Original Turtle Rule Trader Expert Advisor implements a trading system described in the book "The Original Turtle Trading Rules". The EA code implements the visual display of the three Donchian channels, money management, opening and adding trades and moving stop levels.

CandelsHighOpen Expert Advisor is based on the Candels High Open indicator trading signals module. The EA features trading market and pending orders, as well as trailing stop based on Parabolic SAR.

Module of trading signals of the "Candels High Open" custom indicator for analyzing High and Open of the last three bars.

Candels High Open indicator analyzes High and Open of the last three bars.

The Zigzag2_R_Color indicator with the timeframe selection option in the input parameters and display of values as fractal labels.

The simplest Expert Advisor based on MFI.

The simplest Expert Advisor based on RSI.

The Expert Advisor uses Fibo levels and iSAR indicator - Parabolic Stop and Reverse system. Trading is performed using BuyLimit and SellLimit orders.

Crossing of the two iMAs.

Waddah_Attar_Trend indicator features alerts, emails and push notifications.

The Expert Advisor increases the volume of an open position if profit in points from the last trade increases a threshold fixed in the EA inputs.

The Expert Advisor moves a stop loss to a predefined fixed distance from the current price.

Scalpel EA for MetaTrader 5

The Expert Advisor opens trades when the price approaches an integer cent, for example, 1.39, 1.40 or 1.41.

The Expert Advisor moves a position to a breakeven when a predefined profit is reached.

SilverTrend semaphore signal indicator features alerts, emails and push notifications.

The Expert Advisor opens and closes positions at the predefined moments in time.

Non-indicator system based on the analysis of the four previous bars. Implemented partial closing.

The Exp_CenterOfGravityCandles Expert Advisor is based on signals of the CenterOfGravityCandles indicator.

The WPR_Histogram_Round indicator with the timeframe selection option available in the input parameters.

This Expert Advisor closes all positions if the total loss/profit exceeds a predefined limit.

The Expert Advisor is based on a standard trend strategy and the two-layer neural network that is trained to enter the market against a trend.

The MFI_Histogram_Round indicator with the timeframe selection option available in the input parameters.

This Expert Advisor closes all positions if the total profit exceeds a predefined limit.

This Expert Advisor closes all positions if the total loss exceeds a predefined limit.

The indicator shows the price chart of any scaling level.

Analyzing iBullsPower and iBearsPower indicators on the first bar.

Ehlers Center of Gravity indicator in the form of candles.

The trading system based on the three RVI oscillator signals from three different timeframes.

1...789101112131415161718192021...104