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 Libraries for MetaTrader 5

Libraries are small sub-programs containing a certain functionality that can then be used for developing new applications. Once written and thoroughly checked, a library allows users to speed up the development of new MQL5 applications. One of the illustrative examples is ALGLIB library containing multiple numerical analysis functions.

Library source codes can be downloaded and used in MetaEditor when developing trading strategies. They cannot be launched in MetaTrader 5 independently.

To post a new code, please log in or register
latest|best

This is the trading signal of PullBack and Candle. The expert code for this strategy is automatically generated by the MQL 5 wizard.

This is the trading signal of Bollinger Bands. The expert code for this strategy is automatically generated by the MQL 5 wizard.

Libraries based on the article "Random decision forest in reinforcement learning"

The library and iCanvas class simplify writing programs using Canvas.

Access to OnTradeTransaction data anywhere within an application

Converts a number to a text.

The library allows receiving a magic number bound to three elements: symbol name, timeframe and prefix index.

This calculates Optimal f using the Geometric Mean. Per Ralph Vince, "In trading we can count on our wins being for varying amounts and our losses being for varying amounts. Therefore the Kelly formulas could not give us the correct optimal f." So, using his equation(s), I created this library for the Geometric Mean version of Optimal f.

Complete and fast functions similar to Bars and iBarShift from MQL4.

A library to provide simple storage mechanism for expert advisors and indicators.

Handy functions for comparison and rounding of floating-point numbers (prices, lots and money).

A module of trading signals based on the Moving Average indicator signal module.

A module of trading signals based on the Moving Average indicator signal module.

This non-trading utility generates custom symbol information on 1M chart.

This non-trading utility generates custom symbol information on 1M chart. Configure using Tick Size, Pip Size, Points or R. Now with Asymetric Reversals!

Printing GetLastError() and MqlTradeResult retcode as text description.

Increased accuracy of the standard timer.

The EasyAndFastGUI library allows creating graphical interfaces for custom MQL programs.

A module of trading signals based on the signal module of the iCCI (Commodity Channel Index, CCI) indicator.

A library for creating analog clocks using MetaTrader 4/5 graphical resources.

A library for common rounding methods used in MQL development, primitive wrapper class for type (double), and vector for CDouble objects. MQL5 and MQL4 compatible!

An implementation of the dictionary (associative array) data structure in MQL5, based on CArrayObj and CList.

A library for creating icons in the Windows taskbar and for sending text alerts. The use of this library will help you make your MQL programs more informative.

A library for working with chart subwindows.

A library for reading/writing the parameters of arbitrary Expert Advisors.

A library for working with traditional and custom symbols

Measuring the net performance of MetaTrader 4/5 strategy testers.

The MetaTrader 4/5 library allows generating reports based on the trading history.

Returns the profit of a position in points, as well as commission, swaps and profit in money based on the trading history.

The class monitors the emergence of a candlestick

MqlParams container class that uses method chaining to quickly add params and reduce lines of code.

Many traders are interested in native work with the BTC-e exchange directly from MetaTrader. In the exchange API, it is necessary to send data with the confirmation of parameters validity through HMAC-SHA512. The algorithm of SHA512 and HMAC calculation is implemented in this class.

The library makes indicators' Init/Deinit synchronized

Original mathematical functions taken from different places, which either do not have analogues or perform much faster than alternative implementations

This time-series library brings lightning-fast timeseries access to MQL5 for time-sensitive applications while implementing the familiar methods of MQL4, e.g. iBarShift.

A module of trading signals based on the Moving Average indicator signal module.

The CDir class allows getting information about files and folders outside the MQL5 sandbox similar to the MS-DOS Dir command. Call of system DLL is used, therefore you should allow their use.

Returns position profit in points based on the trading history.

The library allows to automatically assign 'magic' to an Expert Advisor on any symbol and any timeframe. It allows having up to 65535 magic numbers in one Expert Advisor.

A library of averaging algorithms, the algorithms were described in details in the article "Averaging Price Series for Intermediate Calculations Without Using Additional Buffers"

123456