MQL4 and MQL5 Programming Articles

icon

Study the MQL5 language for programming trading strategies in numerous published articles mostly written by you - the community members. The articles are grouped into categories to help you quicker find answers to any questions related to programming: Integration, Tester, Trading Strategies, etc.

Follow our new publications and discuss them on the Forum!

Add a new article
latest | best
preview
Weak Supervision for Traders: Combining Several Noisy Labeling Heuristics into One Probabilistic Label (Snorkel-Style)

Weak Supervision for Traders: Combining Several Noisy Labeling Heuristics into One Probabilistic Label (Snorkel-Style)

The article builds an MQL5‑native weak‑labeling engine that infers per‑indicator trust from vote agreement, then fuses five noisy signals into P(Buy) using Expectation‑Maximization. We describe the EA architecture, rolling‑window refits, abstain handling, diagnostics, and a majority‑vote baseline used for comparison. Readers can reuse the EM library, swap in their own labeling functions, and obtain a transparent, probability‑based entry filter.
preview
Local Outlier Factor: Density-Based Anomaly Detection in Native MQL5

Local Outlier Factor: Density-Based Anomaly Detection in Native MQL5

This article builds a native MQL5 LOF engine without DLLs, ALGLIB or ONNX. Bars are mapped to five standardized features; k‑NN reachability and density produce a scale‑free LOF score, and the alarm level is a moving quantile of the reference cloud. The score gates only new entries in an EMA‑cross EA, with an indicator for charting and a script for independent checks on XAUUSD, EURUSD and GBPUSD.
preview
Building AI-Powered Trading Systems in MQL5 (Part 13): Letting the Assistant Execute Trades Behind an Approval Card

Building AI-Powered Trading Systems in MQL5 (Part 13): Letting the Assistant Execute Trades Behind an Approval Card

We extend an MQL5 AI assistant from read-only tools to safe trade execution with a human-in-the-loop gate. The article defines action tools for placing, closing, modifying, and deleting trades and for drawing on the chart, validates each request, sizes volume to broker limits, and scopes ownership. We pause the tool loop behind an approval card, queue actions, and resume execution only after approval, which holds while auto-approval stays off, as it is by default.
preview
Which Economic Releases Actually Move Your Symbol, and by How Much?

Which Economic Releases Actually Move Your Symbol, and by How Much?

A calendar release is not a category but a number against a consensus. In MQL5 we build a robust, standardized surprise (actual minus forecast scaled by each indicator's own dispersion), recover the broker's daylight saving schedule from price to anchor each release on the bar that moved, and regress price response by symbol and horizon. The result is a measurable profile in pips per sigma showing which events actually move your market.