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

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

The 64-bit xoshiro256** Random Number Generator.

Smooth Algorithms - Corrected/Modified

Sort the input array in-place using comparison function less.

for export/import of orders and trades between EAs and terminals

This library shows useful informations and do a lot of functions to a symbol.

Allows you to determine the occurrence of a new bar event in a multicurrency Expert Advisor

The ZigZagExtremaOnArray is an mqh include file which contains the calculation function of MetaQuotes' Examples ZigZag, BUT you can use it on any buffer that contains curves or histograms, similarly to the MovingAverages.mqh from include. The idea was to get highs and lows of an indicator curve quickly with the help of an "onBuffer" function.

Utility for copying transactions from one MT5 account or MT4 account to another MT5 account.

Adds the ability to automatically export the transaction history after running the Expert in the strategy Tester.

from the logistic regression Article, I welcome all the thoughts on how we can build multiple dynamic Logistic Regression

Sorts the values in the first dimension of a multidimensional numeric array in the ascending order.

This EA demonstrates creating and saving a graphic chart using data from the MT5 Strategy Tester.

Simple class for getting the number of microseconds (µs) elapsed since January 1, 1970

A collection of useful string manipulation functions.

Extend of CFile class to work with the .set extension file which terminal will produce when the Input/Optimisation is saved.

This Function will retrieve the Assets next Opening Time and Closing Times, either following the current time or following a given time.

This class loads a licensing file by reading 64bit encrypted account data from a license file into an account array for the purpose of licensing. The Class is initialised with a Filename, a Master Key (m_hkey -> can be a secret key of your choice) and whether the file needs to be saved in the common folders or not.

An easy-to-use multi-currency library, usable in indicators and EA.

hybrid sorting algorithm that provides both fast average performance and (asymptotically) optimal worst-case performance

gnome sort is based on the technique used by the dutch garden gnome

This is a wrap for using databasexxx

a simple sorting algorithm that people use to manually sort cards in a bridge hand

A light header-only version of Log4mql that provides standardized logging.

an in-place comparison sorting algorithm

an in-place comparison sort

a much more efficient version of selection sort

an efficient, general-purpose sorting algorithm

A sorter class to sort an array based on other arrays.

a highly efficient sorting algorithm, based on partitioning of array of data into smaller arrays

represent an operation to be performed on the elements of an object structure. visitor lets you define a new operation without changing the classes of the elements on which it operates

define the skeleton of an algorithm in an operation, deferring some steps to subclasses. template method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure

define a family of algorithms, encapsulate each one, and make them interchangeable. strategy lets the algorithm vary independently from clients that use it

allow an object to alter its behavior when its internal state changes. the object will appear to change its class

An (optional) include file to enhance error code handling experience.

An (optional) include file to enhance debugging experience.

define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically

define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically

without violating encapsulation, capture and externalize an object's internal state so that the object can be restored to this state later

Define an object that encapsulates how a set of objects interact mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently

Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation

123456789