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

icon

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.

Submit your code
latest | best

A price channel based on a bar of user-defined duration (timeframe).

Long Short-Term Memory Neural Network - for time series analysis.

Calculating the best trading interval.

The function for moving an open position to a breakeven.

Virtual trading environment

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, rounding, formatting and debugging of doubles (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.

123456789