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

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

This Expert Advisor performs the synchronization of charts.

This script exports indicator's values to CSV file.

This indicator will allow you to perform the recalculation of the indicator's data only when the new bar on the chart has appeared.

Trade signals based on reversal candlestick patterns is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

New version of the sChartsSynchroScroll script.

The improved version of the ZigZag indicator.

Trade signals based on crossover of lines of the Alligator technical indicator is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

Trade signals based on crossover of main and signal lines of MACD indicator (CSignalMACD from MQL5 Standard Library) is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

Trade signals based on price crossover of two exponentially smoothed moving averages with intraday filter is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

Trade signals based on price crossover of two exponentially smoothed moving averages is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

This script generates a file with its source code (solution of the classical program in MQL5). It may be useful to study programming and algorithms.

Trade signals based on price crossover with moving average indicator confirmed by ADX is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

The DMI Expanded Moving Average Indicator.

Trade signals based on three moving averages is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

Trade signals based on price crossover with moving average indicator (CSignalMA from MQL5 Standard Library) is considered. The code of the Expert Advisor based on this strategy can be generated automatically using the MQL5 Wizard.

The indicator plots a channel using the linear regression model: y=b+a*x.

The ZigzagColor_Channel plots a channel by connecting the ZigZag peaks and ZigZag bottoms.

The Expert Advisor is profitable only if the "Open prices" only or "1 minute OHLC" modes used in Strategy Tester.

If you want to optimize your Expert Advisor using your own characteristics, you can use "Custom max" mode via OnTester() function. This code provides you many characteristics, which can be used during the optimization of your EA. Also it allows you to save the optimized charateristics in HTML file.

The iUSDx indicator uses the "MCM Control Panel" for multicurrency mode. It calculates the USD index.

The Panel Designed for "Best Graphic Panel in MQL5" Contest. This graphic panel allows to automate manual trading. It has many functions, including the visual construction of trading strategies.

The MCM Control Panel provides the solution for multicurrency trading in MetaTrader 5.

The script allows you to place the deals history on the chart using the graphic objects.

The eInTradePanel is a panel for manual trading, it has some useful functions. It needs the minimum space on the chart.

The panel simplifies manual trading and trailing of the opened position.

Control panel for the MQL5 Best Graphic Panel Contest.

This Expert Advisor will simplify the manual trading. It supports the One-Click trading.

Graphic Panel Contest submission.

The script exports historical quotes data from MetaTrader 5 for the import to MetaTrader 4. This solution will allow you to get the full history for MetaTrader 4.

Chart reinitialization with recalculation of all chart indicators.

This indicator is a combination of moving average and ATR indicators.

It has simple code and trading rules. It's doesn't use any martingale MM strategies.

This class provides methods for working with Windows *.ini files.

The OnTick event handler is designed to proceed the ticks for a certain symbol. This is the version of Multicurrency tick event handler.

The indicator shows the trend and allows to see a price range.

The indicator shows deals history on the chart.

Enhance your charts by adding intelligent markers for important price points and the start/end of year/month/week/day/session Includes a price pointer that changes color whenever price is near an important price point (e.g. historical high/low)

Since Terminal build 344 added display of economic calendar news using special graphical objects (OBJ_EVENT). A script that outputs as a demonstration of the Economic Calendar with current economic data, the date of the last major (Pink) event.

This Expert Advisor uses two Moving Averages and RSI indicator.

This trend indicator is based on moving averages.

1...9293949596979899100101102103104