Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Enable two-factor authentication ContinueForget about BMP files like a bad dream. Thanks to this library, you can now use the PNG format, which has a number of advantages, such as being more compact without losing image quality and maintaining transparency.
A set of classes for automatic moving of StopLoss of open positions by fixed indentation or by values of Parabolic SAR and moving averages indicators, or by specified position stop level.
Four EAs on the same symbol, each one honest on its own: each checks "do I have a position?" with its own magic number, sees none, and enters. On a demo account this reached 22 contracts on a symbol meant to carry 1, and a watchdog had to close 16 positions in one morning. The cap belongs at the door, not after the fact. ExposureCap::Allowed(symbol, lots, cap) sums the volume of every open position on the symbol - all magic numbers, manual trades included - and refuses the order BEFORE it is sent when it would breach the cap. One log line with the three numbers (held, requested, cap) says why. Deliberately simple: gross exposure, no netting of longs against shorts, no per-EA quota. It is a check, not a lock: two EAs deciding on the same tick can both pass; in practice EAs on different charts decide on different ticks. The demo script prints held / cap / room for the current symbol and shows the refusal line. Nothing is traded.
Three position-sizing protections that do different things; confusing them is why so many accounts get wiped out: - ladder: one contract per X of balance, always applied as a CAP, even with manual lot sizing; - floor: below the minimum capital it does not trade; a new deposit is needed; - breaker: stops at X% below the peak, at any account size, and does not rearm by itself. What this library solves and almost none does: a deposit is not profit, and a withdrawal is not a loss. The breaker measures the drop against the balance peak. Untreated, a deposit made DURING a drawdown lifts balance and peak together, and the protection stops seeing the drop exactly when it would help. Here deposits and withdrawals shift the peak by the same amount. The peak is persisted to a file: a breaker that forgets the peak on a terminal restart is not a breaker. The demo simulates a deposit at the bottom of a drawdown. Run it with the deposit on and off and compare the "drop" column.
An include file that writes real Excel workbooks (.xlsx) from MQL5 without DLLs: several sheets, numbers, text and real Excel dates, a frozen bold header and filters. Example script: the account deals and the daily results to Excel.
Portfolio weights from the returns of symbols or Expert Advisors: inverse volatility, risk parity, hierarchical risk parity, minimum variance, maximum diversification, Ledoit-Wolf covariance.
Block bootstrap of daily results: how deep the drawdown of an account or strategy can get over the next months, with percentiles and a seeded generator for repeatable runs.
Probability of Backtest Overfitting (PBO) of an MT5 optimization by combinatorially symmetric cross-validation. Every pass sends its daily results as a frame, and the PBO is computed when the optimization ends.
Gaussian hidden Markov model fitted by Baum-Welch: regime probabilities without look-ahead, most likely path, expected durations and regime forecasts.
Online detection of changes in the mean or volatility (Adams-MacKay): probability of a change in the last k bars, current segment length, forecast, and an indicator.
Standalone MQL5 library for storing custom settings separately for each trade and following a verified pending-order-to-position lifecycle. It supports double, ulong and price-unit fields, terminal-local Global Variables, safe cleanup gates and an offline self-test. Includes a demo EA, source archive, and installation guide. A different-ticket transition, reconnection as a separate scenario, and netting behavior remain untested.
A library for MetaTrader 5 that writes every pass of an optimization to a SQLite file: result, test statistics, your own metrics and the inputs of the pass. A demo Expert Advisor optimizes the Rosenbrock function in the mode "Math calculations".
A library for MetaTrader 5 that puts trade management code behind an interface and tests it against a fake broker, without a trade server. The fake checks stops level, freeze level, tick grid and volume step, answers with retcodes chosen by the test and logs every request. An example break-even rule and 26 test cases come with it.
A library for MetaTrader 5 that checks every trade request of an existing Expert Advisor in the Strategy Tester, with one include line and no other change. Volume, stops level, freeze level, margin, trade mode and the order limit are checked; the request then goes out unchanged, and the Journal and a CSV list each violation with the file and line that sent it.
Calculate DST for USA, EUR, AUD and RUB and the offset time of the broker automatically from the 70's until 2030 - even in the Strategy Tester of MQ.
A lightweight tab bar for chart panels, drawn with the standard CCanvas class. One include file, several independent instances per chart, click selection, resizing and safe cleanup. Includes a demo Expert Advisor.
Professional Telegram Bot integration library for MetaTrader 5. Complete solution for sending trading signals, screenshots, reports, and real-time notifications to Telegram channels and groups.
Persistent MQL5 outbox with a Telegram demo and offline tests. An uncertain result is never retried automatically. Manual retry may duplicate a message; SENT means API acceptance, not a read receipt.
This library is an updated version of the ErrorDescription.mqh library published by MetaQuotes, with some features included.
A powerful and feature-rich JSON library for MQL5, designed to bring a modern development experience similar to Python/JS
Complete Telegram integration for MT5. Send trading signals, screenshots, reports & alerts to Telegram channels. Includes queue system, multi-channel support & risk management.
Records ticks in real ticks mode and reads them in maths mode calling your strategy with each tick.
Source codes written in the process of developing a library for creating multi-currency Expert Advisors combining multiple instances of different trading strategies.
Compression of tick data for storage in a compact form up to 3.5 times more compact than .tcs MQ files. And for fast work with them, because reading 3 bytes takes less time than reading 60 bytes of MqlTick structure.
Small MQL5 library that shares an EA's own runtime settings between charts of the same account, with edits from either chart, a file lock and per-field merge.
Class to access to the local time for the specified location, as well as time zone information and the local trading session hours.
A new interface library has been developed to simplify the process of converting MT4 indicators and Expert Advisors (EAs) to MT5. This library supports most of the MetaTrader 4 functions, offering developers a unified solution for cross-platform compatibility.
Securing data transfer between client and Server could be a big challenge for you as MQL5 programmer. You may have experience in using built in MQL5 encryption systems like AES.AES can securely encrypt your data but on the other hand is not secure when it comes to sending the AES key through insecure channels. You can only rely on asymmetric encryption systems Like RSA in such cases. you keep the private key at your server side and only share the public key with your clients. Even more you can use hybrid RSA_AES approach to archive more performance
Automates MQL5 buffer and plot index management. Eliminates manual counting, simplifies Z-order layering, and handles complex plot types (Candles, Color Lines) with a single line of code.
If you have access to the Expert Advisor code, you can save balance and equity charts and calculate additional optimization criteria by adding additional code from this library.
A comprehensive stop-loss and trade management module offering multiple stop-loss methods (Fixed Pips, ATR-based, Swing High/Low, and Percentage) and trailing stop options (Fixed, ATR, Step, and Breakeven). It includes automatic broker stop-level adjustment, risk-reward–based take profit calculation, and visual stop-loss lines on the chart. The code follows a clean, structured architecture with a dedicated `CStopLossManager` class, standardized enums and structures, and fully documented English comments for clarity and maintainability.
A library of 24 MQL5 classes that watches a prop-firm rulebook -- drawdown, daily loss, payout consistency, minimum trading days, news blackout -- against any account, and flattens on breach without ever opening a position of its own.
A real economic-calendar news filter that also works in backtests. Export the events once with a script, then block new entries around news both live and in the Strategy Tester. Fixes the one-hour DST shift of historical calendar times.
Reads a Strategy Tester report saved as HTML into its deals, closed trades, net profit and balance drawdowns, for comparing, combining or exporting backtests.