MQL5 Algo Trading
540K subscribers
3.87K photos
6 videos
3.87K 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
Standard GARCH estimation can converge with parameters pinned near zero and p-values near 1.0. This typically reflects positivity constraints (omega>0, alpha>=0, beta>=0) forcing the optimizer to a boundary rather than matching the data.

EGARCH resolves this by modeling log(variance), keeping variance positive without non-negativity restrictions and supporting leverage effects through an explicit asymmetry term. Negative omega or alpha becomes admissible and can materially change the fitted dynamics.

An MQL5 implementation adds VOL_EGARCH, implements CEgarchProcess with log-space backcasting, grid-search starting values, stationarity constraints on summed beta, recursion-based variance, and simulation-based multi-step forecasts. Mean models are updated to recognize the new volatility process.

Leverage diagnostics include a leverage correlation test, a non-pa...

πŸ‘‰ Read | AlgoBook | @mql5dev
❀11πŸ‘5
Channel Breakout Dashboard is a chart-side informational panel for MetaTrader 5, built to consolidate conditions that typically require multiple indicators. It shows current and higher-timeframe trend, RSI momentum with OB/OS states, volatility via current ATR vs average ATR, an N-bar high/low price channel with breakout status, ADR used vs remaining, live spread classified by thresholds, and a combined bias label: BUY SETUP, SELL SETUP, or WAIT. Updates run on a configurable timer.

Operational impact focuses on faster validation and fewer low-quality entries. Breakouts can be filtered by higher-timeframe alignment, RSI extremes, and volatility regime, while ADR context helps avoid late-day trend entries and supports realistic TP/SL placement. Spread state adds an execution gate during illiquid hours or event spikes.

Multiple instances are supported ...

πŸ‘‰ Read | Freelance | @mql5dev
❀6πŸ‘6
News Trading Dashboard is an on-chart informational panel focused on real-time volatility monitoring. It flags β€œnews spike” conditions by comparing the current bar range (High–Low) to ATR multiplied by a configurable threshold, highlighting abnormal movement typically seen on scheduled macro releases.

Key controls include ATR period as the baseline, spike multiplier as the trigger level, and a UI refresh timer for the footer clock. Panel options cover visibility, theme, font-based scaling, auto-width to prevent clipping, minimum width, and screen anchoring with X/Y offsets.

Multi-instance support uses an InstanceID to run parallel configurations per chart or symbol, with automatic deconfliction if IDs collide.

Common usage patterns include a no-trade filter during red status, momentum entries after the first spike candle closes, mean-reversion on extreme...

πŸ‘‰ Read | Calendar | @mql5dev
❀8πŸ‘4πŸ‘€1
Financial forecasting exposes the limits of β€œone task, one model” pipelines, especially under regime shifts, volatility changes, and mixed sampling rates. Large TS foundation models add scale, but often trade deployment cost for marginal accuracy.

LightGTS proposes period-aware tokenization. Instead of fixed-length patches, sequences are split into full-cycle segments derived from known frequency or FFT-based period detection, keeping token semantics stable across timeframes.

A flex projection layer adapts weights to variable patch sizes via pseudoinverse-based resizing, avoiding destructive interpolation. Forecasting uses non-autoregressive parallel decoding from the final encoder token, reducing error accumulation while keeping the parameter count under 5M.

πŸ‘‰ Read | Freelance | @mql5dev
❀12πŸ‘5
A range panel automates session High/Low calculation from a configurable lookback, removing manual level drawing. It provides a clear status for consolidation versus confirmed breakout using a point buffer, with optional chart lines and floating price tags for on-chart verification.

Multiple instances can run in parallel with separate IDs and lookbacks to add multi-timeframe confirmation without changing charts. Updates run on a timer rather than every tick to reduce terminal load during long sessions. Display controls include theme, text sizing, auto-scaling, corner anchoring, and pixel offsets, plus line style and width.

Common usage includes fading range extremes when price remains within bounds, breakout entries after buffered confirmation with stops back inside the range, opening-range breakout using a short lookback at session start, and conflu...

πŸ‘‰ Read | Signals | @mql5dev
πŸ‘7❀6
In 2001, MetaQuotes was only beginning to introduce algorithmic trading. The first version of MQL was remarkably simple: its entire description fit on a single small HTML page, and the language didn't even have loops or arrays.

Today, MetaTrader 5 is a full-fledged platform for trading and development:

βœ“ MQL5 with Python, ONNX, OpenBLAS, and Git-based Algo Forge storage.
βœ“ A powerful Strategy Tester and cloud computing network.
βœ“ An integrated AI Assistant that can write code, analyze markets, and execute multi-step tasks.

We dug through MetaQuotes archives, old forums, release notes, and algorithmic trading championship materials to reconstruct the journey β€” how, over 25 years, a trading terminal evolved into a powerful platform for algorithmic trading, application development, data analysis, and machine learning.

Read the full story of how MetaTrader and MQL evolved...
πŸ‘13πŸ”₯7❀3πŸ‘1
Rademacher functions are being evaluated as a practical tool for noisy, nonlinear market series where common filters and regressions can lose signal. Key limitations remain: the basis is incomplete and periods are constrained to powers of two, but linear trend components can still be captured with high accuracy.

A period-scaling tweak (order P with multiplier M) reduces sensitivity of higher-order terms, improving robustness to outliers. Using the resulting multi-level smoothing, price is partitioned into discrete levels that behave like support/resistance, with strength derived from the distribution of prices around each level.

Forecasting can be built from empirical PDFs/CDFs of Rademacher coefficients, including SMA range projection by treating SMA deltas as a first-order Rademacher series. A higher-level model pairs a Rademacher-based oscillato...

πŸ‘‰ Read | CodeBase | @mql5dev
❀18πŸ‘6πŸ‘¨β€πŸ’»4
A compact trading panel aggregates trend, momentum, volatility, carry, and upcoming macro events in one view. Sentiment is a technical proxy built from EMA, MACD, and Stochastic. Trend Riding reports direction plus stage (nascent, established, aging, reversal risk). Volatility/Breakout combines ATR, Bollinger squeeze percentile, and Donchian breakout state (testing, confirmed, false). Carry displays long/short swap, while News shows the next relevant calendar event.

Chart overlays include EMA fast/mid/slow, Bollinger Bands, and Donchian channels. Typical usage focuses on filtering: avoid ranges when SIDEWAYS or FALSE BREAK – FADE appears, avoid entries near high-impact events, and prefer positive-swap direction on H4/D1 when aligned with an established trend.

Limitations remain: no automatic entries/exits, sentiment is not COT/fundamentals, and calen...

πŸ‘‰ Read | VPS | @mql5dev
πŸ‘7❀5
Classical moving averages compress a window into one value and miss where the latest close sits within its own recent distribution. Bloch’s RMA ranks the current price inside a sliding window and outputs a fractile on a consistent [0,1] scale across instruments. This differs from Wilder-style β€œRMA” smoothing despite the shared acronym.

An MT5 port is structured as an engine indicator publishing multi-buffer outputs under a strict buffer-index contract, plus read-only panels and an EA. Core code computes SMA as local equilibrium, normalized deviations for window landmarks, then empirical fractiles for the current close and extremes.

A regime detector uses the window’s normalized-return range to classify expansion, contraction, and transition, feeding four cross-strategies implemented in the EA and validated in Strategy Tester.

πŸ‘‰ Read | Docs | @mql5dev
❀16πŸ‘9⚑1
MT5 EA Acceptance Harness is an MQL5 script that validates a bounded entry-state contract using deterministic synthetic fixtures. Eight scenarios are executed: valid closed-bar entry, duplicate signal bar, open-bar rejection, cooldown rejection, cooldown elapsed, no signal, daily lock, and new-day reset.

The report compares expected versus actual decisions and outputs a final pass/fail count. Optional outputs include writing a text report to the terminal Common\Files folder and printing results to the Experts log. The report file name is configurable.

The harness is isolated by design. It uses only synthetic case data, does not read market or account state, and never sends, modifies, or closes orders. Coverage is limited to the included state-transition examples and does not assess strategy quality, execution, profitability, or live-account behavior. Source...

πŸ‘‰ Read | Forum | @mql5dev
❀10πŸ‘4
A Kolmogorov-Arnold Network (KAN) is implemented in MQL5 as an interpretable next-bar predictor: instead of scalar weights and fixed activations, each connection learns a univariate curve. Those edge functions are modeled with cubic B-splines (De Boor–Cox recursion), making each edge linear in its coefficients.

Training becomes a deterministic ridge-regularized least-squares solve via Cholesky factorization, avoiding learning-rate tuning and gradient failures. The library is validated with unit tests (partition of unity, exact linear reproduction, fitting known functions, save/load roundtrip).

A shared feature pipeline converts bars into four normalized inputs (return, RSI, ATR/price, MA slope). The trained model runs as an indicator that plots both predictions and the learned curves, and as an EA tested out-of-sample with modest profit and contro...

πŸ‘‰ Read | AlgoBook | @mql5dev
❀15πŸ‘4πŸ‘¨β€πŸ’»2
Black–Scholes assumptions remain a weak fit for real markets: returns show fat tails, self-similarity across timeframes, and volatility clustering. These effects break independence assumptions and distort historical volatility estimates when news-driven outliers are included.

EA changes for long-option structures: add level-based expiration with a switch and an integer target level. When the rebalancing level reaches the specified number, positions are closed and trading pauses until the next day, subject to liquidity constraints in live venues.

Historical volatility is recalculated adaptively by selecting a window (3–40 days) that minimizes median absolute error versus realized daily ranges, using medians to suppress tail impact.

Written-option risk is capped by adding long wings, forming Short Straddle/Strangle Butterfly variants. Extra strikes and norma...

πŸ‘‰ Read | Signals | @mql5dev
❀22πŸ‘8
LightGTS forecasting is extended into a practical MT5/OpenCL pipeline by turning periodic patching into GPU-generated tokens. Dominant periods are detected via FFT, then each series is split into a fixed token count; patch length follows the current cycle while overlap preserves full coverage without dynamic allocation.

Instead of recomputing projection weights with a pseudoinverse when window sizes shift, a maximum-size weight matrix is kept and unused taps are masked via zero padding. This keeps memory layout stable while adapting to drifting market periodicity.

Three OpenCL kernels complete training: forward adaptive convolution per token, input-gradient accumulation that handles overlapping patches, and an Adam-based weight update over window/filter/channel dimensions. Result: frequency-aware embeddings suitable for Transformer blocks with predic...

πŸ‘‰ Read | Freelance | @mql5dev
❀15πŸ‘11⚑2
False breakouts often hit stops placed at obvious support or resistance. This is amplified by crowding: many traders see the same levels, and liquidity is concentrated around them.

A proposed approach overlays a prime-number density heat map onto price. Prices are converted to integers via a multiplier, then prime counts are computed within a radius using a cached Sieve of Eratosthenes. High density zones are marked blue, low density zones red.

Backtests over five months across FX, crypto, and commodities reported 55–58% alignment between blue zones and reversals versus a ~35% random baseline, with similar behavior across instruments. The tool is positioned as a context filter, not a standalone signal generator.

πŸ‘‰ Read | VPS | @mql5dev
❀23πŸ‘5
CPortfolioAnalyzer is extended beyond basic equity and correlation views to address multi-EA risk visibility and operational controls. Key additions include a strategy-level Drawdown Timeline Heatmap that logs peak-to-exit drawdowns per trade, plus a monitoring loop that enforces user thresholds without blocking the terminal UI.

A mitigation engine adds escalating actions: close positions and delete pending orders, persist strategy blocks via terminal Global Variables, or disable terminal AutoTrading through Windows API messaging. Export is upgraded with detailed CSV plus a styled multi-worksheet Excel XML workbook written directly from MQL5.

A hybrid MQL5-Python pipeline bypasses WebRequest sandbox limits by generating a temp CSV and a standard-library Python script, executing asynchronously via ShellExecuteW, and polling results on OnTimer. Retur...

πŸ‘‰ Read | AlgoBook | @mql5dev
❀14πŸ‘5
A new MT4 support/resistance indicator is available, based on swing-pivot detection rather than highest/lowest-over-N-bars. Nearby pivots are clustered into zones and ranked by verified touch count, shown directly on-chart (for example, β€œx8”) to distinguish frequently tested levels from recent ones.

Chart readability is handled with adaptive zone thickness to prevent overlap across timeframes, plus a distance-based filter that hides zones far from current price. An optional higher-timeframe overlay can display longer-period zones in a separate color and is automatically skipped when it would duplicate the active timeframe.

Proximity alerts are included (pop-up and sound) with a cooldown to reduce repeated triggers. Full source is provided. For information purposes only; no trade execution or management is performed.

πŸ‘‰ Read | AppStore | @mql5dev
❀19πŸ‘3πŸ‘¨β€πŸ’»2πŸ‘€1
Rolling Return Autocorrelation Regime Oscillator reframes autocorrelation for live regime monitoring. Instead of plotting correlation by lag once, it fixes a lag (often 1) and recalculates Pearson autocorrelation each bar over a rolling window of returns, producing an oscillator-like series.

Positive values indicate statistically meaningful return persistence at that lag, which tends to align with trend-following conditions. Negative values indicate serial reversal, which tends to align with mean reversion and range behavior. Readings inside the significance bands suggest no reliable dependence for the chosen window and lag.

Significance bands are computed dynamically at ±Z/√N to separate signal from sampling noise. A raw per-bar estimate is shown alongside an EMA-smoothed line; the smoothed line is the practical regime filter, while the raw line hig...

πŸ‘‰ Read | Quotes | @mql5dev
πŸ‘8❀7πŸ†1
Order Block Mitigation Tracker focuses on what happens after an order block is drawn. Zones are treated as time-sensitive: once price trades back into the area, the block is marked as mitigated, the rectangle fades, and the exact mitigation bar is annotated. This makes β€œfresh vs already used” visible without relying on identical static boxes.

Detection uses an ATR-based impulse filter. On each closed candle, body size is compared to ATR times a configurable multiplier. A qualifying impulse confirms the prior opposite-color candle as the order block, keeping signals tied to displacement rather than minor swings.

Mitigation can be defined by wick touch or candle close. Active blocks can extend forward; mitigated blocks can remain on chart for a fixed bar count. Key inputs include lookback bars, ATR period, impulse multiplier, max tracked blocks, and re...

πŸ‘‰ Read | Freelance | @mql5dev
❀6πŸ‘6✍2