MQL5 Algo Trading
493K subscribers
3.16K photos
1 video
3.17K links
The best publications of the largest community of algotraders.

Subscribe to stay up-to-date with modern technologies and trading programs development.
Download Telegram
GoertzelBrain tackles the main weakness of classic cycle detection: knowing a dominant period and amplitude still doesn’t answer “long or short” in non-stationary markets. It keeps Goertzel’s efficient single-frequency DFT, but adds context with a self-training neural ensemble.

Per bar, it builds a 7-feature vector from spectrum state (dominant period, amplitude, normalized confidence), spectral dynamics (period/amplitude slopes), plus price slope and volatility. Ten small MLPs (7-12-1) train online via single-sample SGD and are averaged to reduce instability.

The output becomes a directional filter: long only when the ensemble is above zero and rising; short when below zero and falling. A hidden buffer is exposed via iCustom() for EA integration, with careful heap allocation to avoid GoertzelCycle pointer lifetime bugs.

👉 Read | Quotes | @mql5dev

#MQL5 #MT5 #AITrading
21👌6
Repeated high/low scans inside trailing stops turn many MT5 EAs into O(N) workloads, creating latency and exit drift on VPS deployments. The article switches to a data-first design: deterministic, cleaned history plus constant-time extrema queries.

A Sparse Table precomputes min/max over power-of-two ranges, built once at init (or refresh) and queried in O(1) via two overlapping blocks. This replaces per-bar lookback loops with indexed range lookups suited to frequent trailing updates.

For reproducible inputs, a Python Polars pipeline cleans broker data (gap handling, interpolation, Hampel outlier filtering, log-return validation) and writes to SQLite. MQL5 reads timestamped, targeted SELECT results to build the table and feed trailing logic without terminal-history inconsistencies.

Trailing decisions add an excursion validator: stops update only wh...

👉 Read | Signals | @mql5dev

#MQL5 #MT5 #AlgoTrading
201
Fractal-based Algorithm (FBA, 2017) tackles continuous optimization by building a self-similar, hierarchical partition of the search space. Instead of sampling uniformly, it repeatedly splits regions and allocates work where good solutions cluster, balancing global exploration with local refinement.

The workflow: generate an initial population, keep the best fraction of points, estimate each subspace’s “potential” by counting how many strong points fall inside, then mark the top-ranked regions and subdivide them. A small share of mutated points injects randomness to reduce stagnation.

The MT5 implementation (C_AO_FBA) models subspaces with bounds, hierarchy level, parent links, and a normalized rank. New populations are generated proportionally to subspace ranks, with safeguards for high dimensions and a hard cap on subspace count to control resources.

👉 Read | Freelance | @mql5dev

#MQL5 #MT5 #algorithm
37
A common rule-based approach in indicator-driven trading uses arrow signals for entries and a central reference line for exits on an existing position.

An arrow is treated as a directional trigger to open a long or short trade. The middle line is then used as the close condition, typically when price crosses it or when the indicator state returns to neutral.

This setup separates entry logic from exit logic and can reduce churn from frequent signal flips. Practical use still requires clear definitions for confirmation, stop-loss placement, and behavior during ranging markets, since both arrows and midline crosses can lag or repaint depending on implementation.

👉 Read | AppStore | @mql5dev

#MQL5 #MT5 #Strategy
223👌3👍2
XANDER Pulse Candles colors price bars using an internal RSI-based momentum oscillator (period 14 by default), removing the need for a separate oscillator pane and keeping bias visible on the main chart.

Color states map momentum and candle direction: Spring Green signals strong bullish bias (momentum above threshold with a bullish close). Deep Sky Blue marks weak bullish bias (momentum bullish with a bearish close). Orange Red signals strong bearish bias (momentum below threshold with a bearish close). Orchid marks weak bearish bias (momentum bearish with a bullish close). Dim Gray indicates neutral conditions.

Three modes are provided: center-line (above/below 50), extreme zones (overbought/oversold activation), and direction (rising/falling momentum). Usage notes include tracking consecutive strong-bias candles, treating mixed colors as fade warnings, ...

👉 Read | AlgoBook | @mql5dev

#MQL5 #MT5 #Indicator
30👍3👌3
DoEasy library update adds two blocks: a DOM snapshot series collection and initial support for MQL5.com Signals objects.

DOM work is consolidated via CMBookSeriesCollection, storing per-symbol CMBookSeries lists with bounded history, auto refresh on BookEvent, lookup by symbol, and access to snapshots by index or millisecond timestamp. Engine.mqh is extended with the new collection, helpers, and an OnBookEvent handler that routes updates to the correct symbol series.

A new “other library classes” section starts with CMQLSignal, modeling a single signal source. It defines integer/double/string property enums, sorting criteria, and wrappers over SignalBaseGet* and SignalInfoGet* for retrieval, comparison, and selection workflows.

👉 Read | Quotes | @mql5dev

#MQL5 #MT5 #AlgoTrading
39👌6👍5🤡32
Directional retail systems often concentrate on forecasting price moves, leaving exposure to macro surprises. A common workaround is using correlation between pairs, but correlation is not tradeable by itself. Assets can remain highly correlated while the spread keeps widening, producing persistent drawdowns.

Institutional stat-arb focuses on cointegration and market-neutral positioning, where the spread between linked assets is expected to mean-revert. A practical implementation is tracking a spread Z-score rather than predicting direction.

Key mechanics: logarithmic spread via ln(A) minus ln(B) to normalize scale and volatility differences, rolling Z-score to quantify deviation in standard deviations, and time-series synchronization to align both instruments even with gaps in broker data.

Execution: select a cointegrated pair, wait for Z-score extr...

👉 Read | VPS | @mql5dev

#MQL5 #MT5 #StatArb
217🎉1👌1
PrecisionSniper is an MT5 indicator that generates long/short signals from a weighted, multi-condition scoring model. Up to eight checks run per bar, and a signal prints only when the total meets a configurable minimum. Outputs are graded A+, A, B, or C, with filters to suppress lower grades and a cooldown to reduce clustering.

Core inputs combine three EMAs (fast/slow/trend) with RSI momentum, MACD histogram expansion, ADX strength with DI alignment, VWAP position, tick-volume surge, and an optional higher-timeframe EMA bias. HTF bias carries the highest single weight and can be used to force alignment with the larger trend.

Trade visualization is built in: entry, structure-based or ATR-based stop, three risk-reward targets, and a ratcheting trailing stop that advances at TP milestones. An on-chart dashboard shows current regime and a historical sig...

👉 Read | Signals | @mql5dev

#MQL5 #MT5 #Indicator
276👍3👌2
This article extends the DoEasy MQL5 DOM toolkit by introducing two core abstractions: a Depth of Market snapshot object and a per-symbol snapshot series. Each OnBookEvent() call pulls MqlBookInfo via MarketBookGet(), converts entries into typed order objects, and stores them inside a snapshot container built on CArrayObj.

A key enhancement is adding a millisecond timestamp property to every DOM order, enabling consistent time-based search and sorting across snapshots even though MqlBookInfo has no native time field. The Select service is updated to support these new criteria, and order descriptions gain optional symbol output to avoid redundancy inside snapshot logs.

The snapshot series class acts like a real-time timeseries: it only accumulates live data, enforces a configurable max size (default 200k), and supports retrieving snapshots by times...

👉 Read | AlgoBook | @mql5dev

#MQL5 #MT5 #AlgoTrading
46👌3👍2
The December 2021 TASC article “The DMH: An Improved Directional Movement Indicator” outlines John Ehlers’ update to classic directional movement by applying Hann windowing.

Directional movement has been used in technical analysis for decades. The original formulation by J. Welles Wilder was constrained by the compute limits of its era, which favored simpler calculations. Ehlers argues that current tooling makes a more modern implementation practical.

DMH typically defaults to Wilder’s 14-bar setting, but the period is treated as a parameter that can be selected by the trader or optimized when embedded in a systematic strategy.

This version adds optional visual states: color shifts on slope change, on zero-line crossover, or no color changes to match the classic presentation. Period sensitivity testing is recommended before using DMH-derived signals.

👉 Read | CodeBase | @mql5dev

#MQL4 #MT4 #Indicator
253👌3🔥2👍1
L1 trend filtering targets trend extraction while suppressing noise and automatically detecting slope breakpoints. The output is piecewise linear, which avoids the lag and slope blurring typical for moving averages and the Hodrick–Prescott filter.

The method is formulated as convex optimization with an L1 penalty on second differences. Sparsity in Dx forces most curvatures to zero, leaving a small set of structural breakpoints. The regularization parameter λ controls segment count; at λ≥λmax the result becomes strictly linear.

Practical MQL5 implementation includes λmax computation, relative tuning via λ=coef·λmax, and linear-time filtering. Delivered components cover trend and slope indicators, multiple residual-volatility variants, and testing hooks for MA, MACD, ADX, and EMA signal filtering.

👉 Read | Calendar | @mql5dev

#MQL5 #MT5 #Indicator
23👌3👍1
Local voice control for MetaTrader 5 can be built without cloud APIs or fragile file polling by combining offline speech recognition with localhost HTTP.

The design splits into three simple processes: a Python listener using Vosk with a restricted grammar and wake-word gating, an MQL5 EA that polls GET /command via WebRequest and executes BUY/SELL/CLOSE actions, and a separate Flask TTS server that speaks confirmations through Windows System.Speech.

Key engineering choices improve reliability: command delivery is one-shot (served then cleared), wake phrase + next-utterance prevents accidental trades, and TTS uses a queued worker so the EA never blocks. Result: low-latency, bidirectional “speak-trade-confirm” interaction suitable for hands-free trading and rapid setup execution.

👉 Read | Freelance | @mql5dev

#MQL5 #MT5 #AITrading
23👌3👍1
Manual account audits in MT5 often mean jumping between history tabs and spreadsheets, with no persistent view on the chart. This article treats the problem as UI engineering: building an Account Audit dashboard as a custom MQL5 indicator that stays compact, readable, and non-intrusive.

The indicator is structured for maintainability: named constants, a single metrics struct (balances, net profit, trades, wins/losses, win rate, withdrawals, composite rating), and small UI helpers to assemble rect-label blocks, text labels, and a star-based rating.

A key design fix is workflow safety. The dashboard can be shown/hidden via a button handled in OnChartEvent, restoring one-click trading when hidden to avoid terminal interaction conflicts. The calculation engine is intentionally deferred; OnCalculate remains empty, leaving a clean plug-in surface for later...

👉 Read | Signals | @mql5dev

#MQL5 #MT5 #Indicator
24🤓3🎉2👌2👍1
The December 2021 TASC article “The DMH: An Improved Directional Movement Indicator” by John Ehlers outlines an updated approach to directional movement using Hann windowing. Directional movement has been widely used for decades, and the original formulation by J. Welles Wilder was constrained by the practical computing limits of its time.

DMH keeps a default length of 14 bars to mirror Wilder’s common setting, but the article argues for making period length configurable. When used inside a rule-based strategy, parameter selection can be handled via optimization rather than convention.

This implementation adds optional visualization behavior beyond the original: color changes on slope shifts, color changes on zero-line crosses, or no color changes for a classic presentation. Period testing is recommended before relying on any signal behavior.

👉 Read | VPS | @mql5dev

#MQL5 #MT5 #Indicator
19👍1👌1💔1
Google Research’s TimesFM, accepted at ICML 2024, applies the foundation-model workflow to forecasting. It is a 200M-parameter decoder-only transformer pretrained on 100B real-world time points, with strong zero-shot results across domains.

A practical setup targets trading: fine-tune TimesFM 2.5 on OHLCV using PEFT/LoRA, keeping trainable weights near 100K by adapting only the last 2 of 20 layers. This reduces overfitting risk on non-stationary series.

An end-to-end MT5 pipeline exports 14 instruments, builds covariates (sessions, economic events, moon phase, technical proxies), fine-tunes, then produces probabilistic forecasts (q10/q50/q90). Results are exported back to MT5 as CSV and rendered via an MQL5 indicator with confidence bands.

👉 Read | AlgoBook | @mql5dev

#MQL5 #MT5 #TimesFM
20👍2👌1
Media is too big
VIEW IN TELEGRAM
We've released a new video demonstrating how to significantly speed up Expert Advisor optimization in MetaTrader 5.

The Strategy Tester lets you run multiple optimization passes in parallel by utilizing all available CPU cores. Instead of testing parameters sequentially, you can distribute the workload and discover the most profitable settings much faster. For even greater performance, connect to the MQL5 Cloud Network. Tens of thousands of cores can reduce optimization time from hours to just minutes.

In this three-minute video, you'll learn how to:

✓ Configure optimization modes (full search and genetic algorithm)
✓ Define testing parameters and input ranges for your Expert Advisor
✓ Connect to the MQL5 Cloud Network and run optimizations in the cloud
✓ Monitor progress, costs, and results in real time
✓ Analyze results and identify the best-performing parameters
✓ Earn by contributing your own computing resources

Comment the video:
👉 MQL5.community for traders
👉 MetaQuotes official YouTube channel
9👍1👌1
This article demonstrates how to turn MetaTrader 5 into a lightweight visualization runtime using the MQL5 canvas, not indicator buffers. The focus is rendering a parametric butterfly curve with a clean math-style presentation inside a draggable, resizable floating panel.

Key techniques include supersampling via an offscreen high-resolution canvas and manual downsampling with per-pixel ARGB averaging for smooth anti-aliased curves. The plot adds a gradient background, axis grid with readable tick generation, rotated labels, and a four-segment color legend to show how the curve builds over 0..12π.

The implementation also covers practical UI mechanics: hit-testing header and resize zones, clamped resizing to chart bounds, synchronized layer updates across multiple canvases, and redraw orchestration for responsive in-terminal tools.

👉 Read | Quotes | @mql5dev

#MQL5 #MT5 #AITrading
11👍1👌1
Market Entropy Indicator logic has been formalized into an MQL5 Expert Advisor to remove manual monitoring issues such as inconsistent interpretation and late capture of compression-to-expansion transitions.

The EA computes fast/slow/base Shannon entropy from up/down/flat bar states on every tick, then derives divergence, momentum, regime (trend/transition/chaotic), and compression/decompression states. Signals come from entropy crossovers with momentum and regime filters, plus compression breakout and decompression-end triggers.

Execution is deterministic and parameterized: LotSize, SL/TP, MagicNumber, MinSignalGap, optional reverse-on-opposite-signal, and retry logic. It renders arrows and regime labels, enforces one trade per bar, supports daily resets, and logs all actions for Strategy Tester and live validation.

👉 Read | Signals | @mql5dev

#MQL5 #MT5 #EA
112👌2👍1
HSIC (Hilbert-Schmidt Independence Criterion) answers a core algo-trading question: do features truly relate to the target, beyond out-of-sample hope. Unlike Pearson correlation, HSIC detects both linear and non-linear dependence using kernel similarity matrices, working with scalars or high-dimensional vectors without explicit joint distribution modeling.

The article implements HSIC in MQL5 with an RBF (Gaussian) kernel, including practical sigma selection via a median-distance heuristic and efficient distance computation in matrix form. Significance is handled two ways: an exact permutation test (accurate but costly) and a gamma approximation (much faster, best for large datasets).

A synthetic trading-style example shows HSIC recovering a non-linear dependency where correlations are near zero, making it useful for feature screening and subgroup testing before...

👉 Read | Docs | @mql5dev

#MQL5 #MT5 #HSIC
322👍21🤯1👌1👀1
An experimental CCI-style indicator modifies the original CCI calculation, producing substantially different absolute values. As a result, fixed threshold usage typical for classical CCI becomes unreliable.

To address this, dynamic levels are added using a Donchian-channel-like approach, allowing context-aware bounds that adapt to recent ranges.

Multiple average types are supported for the core computation and for optional price smoothing. The smoothing layer can act as a signal filter without adding material lag.

Operational guidance centers on using color-state changes as signal events. Side-by-side comparisons with classical CCI show that while numeric outputs differ, relative behavior such as slopes and turning points remains broadly consistent.

👉 Read | Quotes | @mql5dev

#MQL5 #MT5 #Indicator
6👏2