MQL5 Algo Trading
574K subscribers
4.45K photos
7 videos
4.46K 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
ATR Monitor adds a compact volatility and direction panel for Day, Week, and Month on any chart. It compares each period’s current high–low range with that timeframe’s built-in ATR and shows whether price is trading above or below the period open.

The table reports ATR (pips), Range (pips), ATR % (Range/ATR*100), and From open (pips). ATR % uses the full high–low distance, while From open is directional, with positive and negative values color-coded and near-zero treated as neutral. Readings at or above MaxATRPercent are highlighted; default is 100% and affects highlighting only.

ATRPeriod defaults to 14 and is applied separately to D/W/M. Values use the current forming candle (shift 0), so ATR and range update during the period and follow broker candle boundaries. Range is high–low, while ATR uses true range and can reflect gaps.

Panel position, size, a...

👉 Read | CodeBase | @mql5dev
👍10🔥6❤5🤩4👌1
This article scales an AI “council” trading architecture from one symbol to eight, acknowledging that FX behavior depends on correlations and regime shifts across pairs. Each symbol runs as an isolated world with its own state, PnL targets, reputation history, and decision dynamics.

The Python server spins up eight PortContext instances and routes WebSocket sessions by a deterministic Magic/Port mapping, so MT5 needs only a preset. The EA stays minimal: consume a single JSON decision, open/hold/reverse one position, place SL/TP immediately, and keep broker-side protection if the link drops.

Decision-making is a three-phase parallel pipeline: 10 diverse analysts generate directional opinions, 4 risk managers gate trades on independent risk axes, then a low-temperature Chairman applies a strict voting procedure. A per-pair reputation engine with deca...

👉 Read | Quotes | @mql5dev
❤22👍11🔥8🤩7👌1
This article reframes chart intuition as time-series regression: modeling returns as stochastic processes, separating signal from noise, and using residuals as the primary diagnostic stream rather than an afterthought.

It starts with the constant-only model for log returns, showing how mean and variance are estimated, why unbiased variance needs n-1, and how confidence and prediction intervals rely on Student’s t when parameters are estimated.

Model trust is built through residual audits: ACF/Ljung–Box for dependence, Jarque–Bera for distribution shape, and Pettitt tests to catch mean or volatility regime breaks early.

It then extends to two-variable regression and stresses a critical implementation detail for MT5 quants: deterministic, exogenous, and endogenous regressors require different assumptions; ignoring regressor type can produce misleadin...

👉 Read | Freelance | @mql5dev
👍15❤11🔥8🤩7👌1
Part 2 of the Position Lifecycle Manager shifts order submission into the manager and removes chart-symbol coupling. Position discovery becomes position-centric, enabling adoption and management across multiple instruments from a single chart attachment.

Two modes define adoption rules. EA Mode uses a magic number and routes trade intents into manager-owned execution. Manual Mode adopts all open account positions, regardless of origin, and applies the same lifecycle rules, including potential SL/TP changes.

After adoption, the position symbol becomes authoritative for pricing, broker constraints, tick grid, volume rules, StopsLevel/FreezeLevel, and execution settings. Protection is staged: SL and TP are applied sequentially with retries and failure surfacing. Break-even is handled as a state transition with throttled reattempts. Telemetry exposes r...

👉 Read | Calendar | @mql5dev
👍17❤12🔥9🤩4👌1
Most trend-following indicators trade responsiveness for smoothness, typically via a fixed moving-average length. A scalar Kalman Filter makes the trade-off explicit by tracking uncertainty and computing the Kalman gain from two user-set variances: process noise Q and measurement noise R. The gain converges to a steady-state level driven by Q/R.

Applied to price, the local-level model treats each close as a noisy observation of an underlying true price. Each bar runs a predict step (state carried forward, variance grows by Q) and an update step (state corrected using gain and R). Correct recursion and initialization matter; wrong startup often looks plausible but is incorrect.

A practical signal uses two independent filters with different Q values and shared R. Example: Q=1.000,R=0.200 yields gain ~0.854; Q=0.005,R=0.200 yields ~0.146. In MT5/MQL5, ...

👉 Read | Signals | @mql5dev
❤17👍10🔥9🤩5👌1
Gaussian Process forecasting is sensitive to feature design. A rolling-window bar index input keeps the kernel geometry nearly constant, producing near-constant predictive variance and turning the horizon step into extrapolation rather than a market forecast.

The described MQL5 engine uses previous-bar log return as x and horizon-ahead log return as y, with input/target standardization to keep length-scale and likelihood scoring stable across regimes.

Implementation details include a symmetric kernel matrix, adaptive-jitter Cholesky, and explicit separation of latent variance from observed variance by adding noise only for realized forecasts. Hyperparameters are searched in log-space with a pure log marginal likelihood routine that avoids mutating fitted state mid-search.

Validation is framed as a calibration check: log forecasts and verify 1-sigma and 2-sig...

👉 Read | Quotes | @mql5dev
❤16👍9🔥6🤩6👌2
STE-FlowNet reframes sequence modeling as adaptive perception: each new event updates internal representations instead of averaging history like typical LSTM/GRU, improving responsiveness to regime shifts, volatility bursts, and rare patterns.

The pipeline treats data as event streams. Events are split into equal-count chunks and reweighted by temporal concentration using a Gaussian fit, so dense bursts get amplified rather than diluted by aggregation. This preserves short-lived, high-impact microstructure signals.

Architecturally, it uses an encoder–decoder with skips, residual blocks, multi-scale intermediate outputs, and ConvGRU at multiple resolutions to retain local detail while building global context. A correlation step aligns features to prior estimates, then iterative residual refinement updates predictions with shared weights for stability.

Trai...

👉 Read | CodeBase | @mql5dev
❤12👍11🔥4🤩3👌2
Comparing two forecasters with equity curves is unreliable when losses are heteroskedastic and serially correlated. A formal alternative is the Diebold–Mariano test on the loss-differential series, with HAC long-run variance and the Harvey–Leybourne–Newbold small-sample adjustment.

An MQL5 implementation runs natively with Newey–West variance correction and an internal Student-t CDF/quantile to avoid library dependencies. Verdicts include significant A/B outperformance, no significant difference, and explicit rejects for insufficient sample, invalid horizon, or invalid variance.

The EA and a subwindow indicator compute rolling DM statistics live. Two fixed forecasters run side by side (ONNX vs EMA slope), validated feature vectors prevent NaN/Inf contamination, and a manifest controls horizon, window, alpha, and loss type without recompilation.

👉 Read | Quotes | @mql5dev
❤7👍7🔥4🤩3👌2
This article builds a Hyperdimensional Computing library for MetaTrader 5 that replaces heavy retraining with fast online learning. Models are binary hypervectors; learning becomes integer accumulation, enabling per-bar updates in ~337 µs while reproducing full refits bit-for-bit when corrections are disabled.

Core algebra is minimal and testable: bind via XOR (distance-preserving), bundle via per-bit majority with a deterministic tie-breaker, and permute via bit-rotation to encode order. Dimension controls collision risk and provides a closed-form noise floor, so similarity thresholds are derived analytically rather than via expensive resampling.

Feature values are encoded with an exact “level ladder” where distances between quantized levels are guaranteed by construction. Bars are encoded by binding feature roles to quantized levels then bundling; seq...

👉 Read | AppStore | @mql5dev
❤10👍8🔥2🤩2👌2
Benchmark wins can be misleading when an optimizer’s step geometry accidentally matches a test function’s geometry. The article shows three failure modes: SDO scoring high because its pairwise coordinate coupling matches duplicated 2D benchmarks; DOAm showing sharp Forest/Hilly asymmetry; and HHO exploiting a “diagonal effect” caused by using one scalar factor to scale all coordinates, producing correlated straight-line trajectories.

To make benchmarks fair, extrema should avoid privileged structures: not on domain boundaries (benefits clipping/overshoot), not at the center (benefits averaging/center drift), and not near main diagonals. A practical diagonal test is |x_norm − y_norm| > 0.3 for the global maximum.

The piece provides actionable tooling: an MQL5 verifier (VerifyExtremes.mq5) to validate extrema positions and a workflow for adjusting fu...

👉 Read | NeuroBook | @mql5dev
❤11👍5🔥3🤩2👌2
A request surfaced around “Align Mean” and identifying an optimum setup that improves overall profit visibility across all charts.

This typically means standardizing how mean/average reference lines are calculated and displayed so results can be compared between symbols and timeframes without changing parameters per chart.

Key points to validate include: consistent lookback windows, identical price sources (close vs typical), timeframe normalization, and whether the mean is fixed, rolling, or session-based. Any “optimum” setting should be tested with identical inputs across charts, using the same risk model and transaction cost assumptions.

👉 Read | CodeBase | @mql5dev
❤14👍12🤩2👌2
Quant Ultimate Momentum Pro v5.4 is a momentum indicator aimed at reducing moving-average lag by projecting short-term momentum from price-derived velocity (MACD) and acceleration (OSMA). The model applies statistical filtering to manage noisy conditions and focuses on closed-bar confirmation for reversal signaling.

Core functions include adaptive volatility control using OSMA standard-deviation bands to scale thresholds as conditions change, plus fractal dimension checks (FDI) to suppress random-walk behavior and low-quality momentum swings.

Visual output is rendered directly on the main chart via candle coloring to highlight trend state and transitions. An alert layer supports push and audio notifications on confirmed reversals.

Typical deployment targets M5, M15, and H1 across indices, FX, and crypto, with EMA defaults aligned to 12/26/9 and adju...

👉 Read | Freelance | @mql5dev
❤19👍10🤩5🔥4👀2👌1
Gemini AI has released Quant 2nd Model, targeting quantitative workflows that combine data preparation, model building, and evaluation. The update focuses on improved handling of time-series inputs, more consistent numerical reasoning, and better instruction adherence during multi-step tasks.

The model is positioned for analysis pipelines that require structured outputs suitable for downstream code generation and integration. Reported changes also include stronger context retention across longer prompts and fewer formatting deviations in generated results.

For engineering teams, the practical impact is expected in faster prototyping, reduced post-processing of responses, and more predictable behavior when automating research and reporting tasks.

👉 Read | CodeBase | @mql5dev
❤23👍11🤩6🔥5👨‍💻3🏆2✍1
MetaTrader 4 can run indicators written in MQL4, while MQL5 indicators target MetaTrader 5 and use a different event model, data access layer, and trade API. There is no drop-in compatibility between MT4 and MT5 indicator binaries, and most non-trivial source code requires refactoring.

Porting typically involves replacing indicator buffers and OnCalculate logic differences, adapting time series access (CopyBuffer/CopyRates patterns versus direct indexing assumptions), handling symbol/period specifics, and reworking any order or position-related code. Build processes, libraries, and strict compilation settings also differ, so identical behavior requires validation on historical and live ticks.

👉 Read | VPS | @mql5dev
❤14👍11🔥6🤩6👌2
Point & Figure configuration supports fixed box size (points) or ATR-based sizing to adapt per symbol and timeframe. Reversal count is configurable (default 3 boxes). Price source can be Close or High/Low, with pattern names rendered directly on the chart.

Built-in pattern detection covers double/triple top breakouts, double/triple bottom breakdowns, bullish/bearish catapults, and triangles. Breakout BUY/SELL signals can be filtered by higher low / lower high rules, EMA trend, ADX minimum, trading session, and optional triggering only on direction change.

An on-chart info panel (Full/Compact/Minimal) reports signal, entry, SL, TP, risk/reward, lot sizing from risk %, spread, ATR, P&F structure, plus warnings for oversized SL, late entries, or wide spreads. R1/R2/S1/S2 support/resistance lines are derived from P&F columns. Alerts include popup, sound,...

👉 Read | Freelance | @mql5dev
❤24👍7🔥5🤩4👏2👌2
A breakout indicator built on confirmed swing highs and swing lows. Nearby highs are grouped into resistance zones and nearby lows into support zones, with a minimum touch count required before a zone is treated as valid.

Signals trigger only on candle close. A bullish close above qualified resistance prints a blue zone rectangle and bullish arrow. A bearish close below qualified support prints a red zone rectangle and bearish arrow. Rectangles use transparent gradient fills to keep candles readable.

Directional confirmation is selectable: session VWAP (default), SMA (period configurable, default 20), SMMA, or None. A separate panel shows only the latest accepted breakout direction, not trade status.

Primary testing focus is XAUUSD on M5, with M15/M30 as cleaner but less frequent alternatives. Suggested execution is next-candle entry after confirmat...

👉 Read | Freelance | @mql5dev
👍19❤18🔥10🤩10😁4👌4
GER40 Evening Coil is a free, open-source EA for the German 40 index on H1. It is long-only, takes one position at a time, requires four entry conditions, places a stop loss on every trade, and forces a flat book by 23:00 server time. Entries are limited to the evening session after the Frankfurt cash close.

Backtest (GER40 H1, 2022-01-01 to 2026-10-13) used a $10k start and fixed lot 5 with no compounding. Net profit: +$37,647 (+376.5%). Max equity drawdown: 10.5%. Profit factor: 2.07. Win rate: 62.6% (291/465), about 97 trades/year. Avg win/loss: $250.81 / $203.10. Longest losing streak: 5.

Signal logic: no volatility spike (10-bar vs 100-bar returns), tick volume not below its 50-bar average, a low-volume regime over 252 bars, and a recent NR7 within the last 13 bars. Execution buys next bar open, SL 3.5 ATR, TP 4.5 ATR, with time-based exits.

Robustness w...

👉 Read | AppStore | @mql5dev
❤18🔥12👍11🤩8👌1
USDX Trader v1.33 is a maintenance update focused on bug fixes for an MT5 EA that builds a synthetic US Dollar Index from major USD pairs already present in Market Watch.

The EA publishes the index as a custom chart symbol, so standard timeframes, indicators, and drawing tools can be used. Trading is executed as a weighted basket across the underlying pairs, with virtual take-profit and stop-loss evaluated on the index level rather than per-leg prices.

It supports multiple presets (ICE-style 6-leg USDX, broad-dollar baskets, equal-weight majors, and custom 1–12 legs), automatic symbol-name detection, and a plan table showing leg sizing and rounding. Recent bars can be rebuilt from real ticks for more accurate highs/lows. Strategy Tester is supported via a virtual index with an optional EMA-crossover auto mode intended for demonstration, not optimisation.

Key c...

👉 Read | NeuroBook | @mql5dev
👍18🤩13❤12🔥11🤯2🏆2👌1
Modern market feeds increasingly behave like event streams where tick timing, impulse size, and inter-event gaps carry signal that OHLC bars often discard.

An event-driven pipeline aligned with STE-FlowNet is being adapted from optical event-flow to financial microstructure, targeting real-time direction inference from unfolding activity rather than post-close features.

Implementation work is moving from theory to modules: a GPU/OpenCL state stack that shifts in-kernel to support effectively infinite sequences, with gradients routed only to the current top element via de-concatenation.

Next is a correlation module: dot-product similarity between the current unit-sequence descriptor and all stacked states, preserving comparable correlations without a fixed reference frame.

👉 Read | CodeBase | @mql5dev
❤7👍6🤩6🔥4👌2
Traders periodically need an objective volatility estimate that is less sensitive to outliers than standard range-based measures.

One method applies a Winsorisation-like workflow to the price series. Price samples are sorted, then the successive rate-of-change between adjacent sorted values is computed and aggregated. Larger outputs indicate a wider dispersion of values, which typically aligns with higher volatility regimes.

A key limitation is direction blindness: sorting removes the path information, so trend and mean-reversion can produce similar readings. A practical adjustment is to include a time component in the value representation so that temporal ordering influences the computed differences.

👉 Read | Signals | @mql5dev
❤7👍6🔥4🤩4👌2
Breaking news can invalidate technical signals mid-trade, so this approach adds real-time news sentiment as a dynamic filter inside an MT5 Expert Advisor.

A REST API provides bullish/bearish/neutral labels plus a confidence score. The EA uses this to confirm entries (skip buys during strong bearish sentiment) and to trigger early exits when sentiment reverses against an open position, while ignoring low-confidence or neutral readings to avoid noise.

Implementation is straightforward in MQL5: WebRequest on an OnTimer schedule, JSON parsing into a small sentiment structure with short history, and helper functions for “meaningful” sentiment and reversal checks.

Key caveats: WebRequest won’t run in Strategy Tester, so record/play back sentiment for testing; tune confidence thresholds and update frequency; verify Yahoo Finance instrument symbols; protect API k...

👉 Read | Forum | @mql5dev
❤13🤩8🔥7👍4👌2