Trading losses are usually tied to risk drift: daily limits get exceeded after a losing trade, drawdowns accumulate unchecked, and predefined rules are ignored at execution time.
A MetaTrader 5 risk layer can remove that failure mode. An include-based EnhancedRiskManager.mqh centers on CEnhancedRiskManager, enforcing per-trade risk, daily drawdown, and total drawdown with conservative/moderate/aggressive presets, plus adaptive balance/equity drawdown measurement and state persistence via terminal globals.
Stress test: an aggressive martingale grid (1.5x, 200-point steps, up to 8 positions, no SL). Baseline lifespan averaged 3.2 days with 100% drawdown. With limits (5% daily, 10% total, 2% per trade), the 9-year run stayed profitable: max daily DD 4.8%, max total DD 9.7%, total return 127%, using trade blocking, forced close near limits, and profit trailing.
π Read | Docs | @mql5dev
A MetaTrader 5 risk layer can remove that failure mode. An include-based EnhancedRiskManager.mqh centers on CEnhancedRiskManager, enforcing per-trade risk, daily drawdown, and total drawdown with conservative/moderate/aggressive presets, plus adaptive balance/equity drawdown measurement and state persistence via terminal globals.
Stress test: an aggressive martingale grid (1.5x, 200-point steps, up to 8 positions, no SL). Baseline lifespan averaged 3.2 days with 100% drawdown. With limits (5% daily, 10% total, 2% per trade), the 9-year run stayed profitable: max daily DD 4.8%, max total DD 9.7%, total return 127%, using trade blocking, forced close near limits, and profit trailing.
π Read | Docs | @mql5dev
β€30π¨βπ»4π1
MT5 restarts clear an EAβs in-memory state, resetting risk counters, regime flags, optimization schedules, and runtime toggles. Production systems need deterministic continuity, not a fresh start after every terminal interruption.
The article builds a native MQL5 persistence layer using a readable key=value flat file in MQL5/Files/, avoiding SQLite, terminal GlobalVariables, and external dependencies. Flat files stay inspectable and per-EA, while GlobalVariables are shared, double-only, and opaque.
The design is modular: a typed value wrapper with safe type inference, a strict line parser (whitespace, comments, key validation), a serializer for consistent formatting, and a CHashMap-backed cache for O(1) reads. Writes rewrite the small file (O(n)), trading simplicity for reliability and easy integration into existing EAs.
π Read | Forum | @mql5dev
The article builds a native MQL5 persistence layer using a readable key=value flat file in MQL5/Files/, avoiding SQLite, terminal GlobalVariables, and external dependencies. Flat files stay inspectable and per-EA, while GlobalVariables are shared, double-only, and opaque.
The design is modular: a typed value wrapper with safe type inference, a strict line parser (whitespace, comments, key validation), a serializer for consistent formatting, and a CHashMap-backed cache for O(1) reads. Writes rewrite the small file (O(n)), trading simplicity for reliability and easy integration into existing EAs.
π Read | Forum | @mql5dev
β€31π4
Four intrabar entropy estimatorsβShannon, Plug-In (w-grams), LempelβZiv complexity, and Kontoyiannis entropy rateβare ported from a NumPy/Numba Python reference to practical MQL5 code for MetaTrader 5.
The design works around MT5 constraints: intrabar ticks come only from the broker-limited CopyTicksRange() cache, so older bars are marked with a sentinel (ENT_EMPTY). Bars also require a minimum tick count to avoid meaningless estimates.
Tick directions are encoded from bid changes into a compact ternary uchar stream {0,1,2}. Sequential estimators avoid missing Python primitives by using a base-3 hash for overlapping w-gram counts and a bounded look-back window to cap Kontoyiannisβ O(nΒ²) search.
Integration targets live use: a single Calculate() call per new bar updates feature arrays, with explicit sentinel checks to prevent trading on missing tick history....
π Read | Signals | @mql5dev
The design works around MT5 constraints: intrabar ticks come only from the broker-limited CopyTicksRange() cache, so older bars are marked with a sentinel (ENT_EMPTY). Bars also require a minimum tick count to avoid meaningless estimates.
Tick directions are encoded from bid changes into a compact ternary uchar stream {0,1,2}. Sequential estimators avoid missing Python primitives by using a base-3 hash for overlapping w-gram counts and a bounded look-back window to cap Kontoyiannisβ O(nΒ²) search.
Integration targets live use: a single Calculate() call per new bar updates feature arrays, with explicit sentinel checks to prevent trading on missing tick history....
π Read | Signals | @mql5dev
β€35π2
Multi-symbol risk often gets understated when per-trade sizing is evaluated in isolation. During macro releases, EURUSD, GBPUSD, and XAUUSD can move in the same direction on the same driver, turning three 1% allocations into a fast 3% portfolio hit.
Single-instrument volatility is useful but incomplete for portfolios. The missing component is co-movement, captured by the covariance matrix. Portfolio variance is wα΅Ξ£w, not the sum of individual variances; cross terms dominate when correlations rise.
A practical MQL5 implementation centers on PortfolioRiskAnalyzer.mq5: fetch multi-symbol closes, compute log returns, assemble a returns matrix, then compute Ξ£ via matrix.Cov() and risk via MatMul(). Recent MT5 builds back these operations with OpenBLAS for scalable linear algebra.
π Read | VPS | @mql5dev
Single-instrument volatility is useful but incomplete for portfolios. The missing component is co-movement, captured by the covariance matrix. Portfolio variance is wα΅Ξ£w, not the sum of individual variances; cross terms dominate when correlations rise.
A practical MQL5 implementation centers on PortfolioRiskAnalyzer.mq5: fetch multi-symbol closes, compute log returns, assemble a returns matrix, then compute Ξ£ via matrix.Cov() and risk via MatMul(). Recent MT5 builds back these operations with OpenBLAS for scalable linear algebra.
π Read | VPS | @mql5dev
β€21π3
Many EAs generate signals but lack an authorization layer between detection and execution. That gap causes premature entries, late trades after expiry, and interference from other EAs or manual orders.
A discipline model can formalize setup lifecycle states: NO_SETUP, SETUP_FORMING, SETUP_CONFIRMED, SETUP_ACTIVE, SETUP_EXPIRED. Execution becomes state-driven, not pattern-driven.
Trade authorization rules can be centralized in a CanTrade() gate: confirmation, expiry window, freshness, session filter, and a global lock.
Enforcement is handled separately via CDisciplineGuardian: alert, auto-close, or auto-close plus terminal-wide lock. Visibility is provided by CDisciplinePanel with on-chart status for state, permission, expiry, freshness, session, and guardian mode.
Integration into an EA routes every order through the layer before any execution call.
π Read | Docs | @mql5dev
A discipline model can formalize setup lifecycle states: NO_SETUP, SETUP_FORMING, SETUP_CONFIRMED, SETUP_ACTIVE, SETUP_EXPIRED. Execution becomes state-driven, not pattern-driven.
Trade authorization rules can be centralized in a CanTrade() gate: confirmation, expiry window, freshness, session filter, and a global lock.
Enforcement is handled separately via CDisciplineGuardian: alert, auto-close, or auto-close plus terminal-wide lock. Visibility is provided by CDisciplinePanel with on-chart status for state, permission, expiry, freshness, session, and guardian mode.
Integration into an EA routes every order through the layer before any execution call.
π Read | Docs | @mql5dev
β€32β‘3π3β2
A free script is available for closing all open positions in compliance with FIFO rules. It can be attached to a chart via drag-and-drop and will process open trades regardless of whether they are in profit or loss.
Autotrading must be enabled before execution. After activation, the routine issues close requests in FIFO order until no eligible positions remain.
Operational use should account for broker constraints, partial fills, and slippage, and should be validated on a demo environment before running on a live account.
π Read | Calendar | @mql5dev
Autotrading must be enabled before execution. After activation, the routine issues close requests in FIFO order until no eligible positions remain.
Operational use should account for broker constraints, partial fills, and slippage, and should be validated on a demo environment before running on a live account.
π Read | Calendar | @mql5dev
β€14π5π3β1
Transformers bottleneck on market history because attention scales as O(NΒ²), making multi-thousand-bar context too slow for latency-sensitive trading. Mamba replaces attention with Selective State Space Models, delivering O(N) sequence processing and effectively unbounded context.
Its core gain is selective memory: SSM dynamics adapt to the input so the model reinforces regime shifts (volatility spikes, news-like shocks) while damping routine noise. The block design combines local convolution for short-term structure, a selective SSM for long memory, gating for controlled information flow, plus stability-focused initialization (HiPPO) and training with AdamW. Patching further reduces compute by turning bar groups into meaningful tokens.
A MetaTrader 5 implementation (ModernAI_Expert.mq5) shows practical integration: normalized price/volume inputs,...
π Read | Quotes | @mql5dev
Its core gain is selective memory: SSM dynamics adapt to the input so the model reinforces regime shifts (volatility spikes, news-like shocks) while damping routine noise. The block design combines local convolution for short-term structure, a selective SSM for long memory, gating for controlled information flow, plus stability-focused initialization (HiPPO) and training with AdamW. Patching further reduces compute by turning bar groups into meaningful tokens.
A MetaTrader 5 implementation (ModernAI_Expert.mq5) shows practical integration: normalized price/volume inputs,...
π Read | Quotes | @mql5dev
β€24π5π2π2
Quasimodo reversals are hard to trade manually because the βshapeβ is subjective and entries often feel late. This article turns the QM idea into a rule-based MT5 EA that detects the pattern, confirms it with a break of structure, then enters only after a retrace to the QM (left-shoulder) level.
Detection is built on confirmed swing pivots: a pivot is accepted only after N bars close on both sides, then compressed into an alternating zig-zag by merging consecutive same-type pivots into the most extreme point. A prior-trend filter validates there was a real trend before the reversal.
Execution is fully structured: entry at the QM line, invalidation beyond the head, target at the broken leg level, with optional close-back-through confirmation, reward/risk filtering, risk-based lot sizing, trailing/TP modes, trade-record syncing after restarts, and vi...
π Read | Signals | @mql5dev
Detection is built on confirmed swing pivots: a pivot is accepted only after N bars close on both sides, then compressed into an alternating zig-zag by merging consecutive same-type pivots into the most extreme point. A prior-trend filter validates there was a real trend before the reversal.
Execution is fully structured: entry at the QM line, invalidation beyond the head, target at the broken leg level, with optional close-back-through confirmation, reward/risk filtering, risk-based lot sizing, trailing/TP modes, trade-record syncing after restarts, and vi...
π Read | Signals | @mql5dev
β€38π2
Parts 2β6 generate eleven oneβminute environment metrics. Acting on all of them in real time is impractical for sizing and risk controls, so Part 7 reduces the vector to a single regime label plus quality scores.
RegimeClassifier() maps the metrics into six regimes: Normal, Stressed, Noisy, Informed, Trending, MeanβReverting. It returns confidence in [0,1] and a composite directional score in [-1,+1]. Boundaries are percentile thresholds calibrated on 514 NQ M1 sessions (May 2024βMay 2026).
Classification is rule-based with priority ordering: Stressed, Informed, Trending, Noisy, MeanβReverting, Normal. Reliability is the geometric mean of MFDFA fit confidence and flow_confidence; roll confidence is excluded. Deliverables include MARKET_REGIME, RegimeAnalysis, RegimeClassifier(), and PopulateRegimeAnalysis() calling Parts 2β6 sequentially.
π Read | Docs | @mql5dev
RegimeClassifier() maps the metrics into six regimes: Normal, Stressed, Noisy, Informed, Trending, MeanβReverting. It returns confidence in [0,1] and a composite directional score in [-1,+1]. Boundaries are percentile thresholds calibrated on 514 NQ M1 sessions (May 2024βMay 2026).
Classification is rule-based with priority ordering: Stressed, Informed, Trending, Noisy, MeanβReverting, Normal. Reliability is the geometric mean of MFDFA fit confidence and flow_confidence; roll confidence is excluded. Deliverables include MARKET_REGIME, RegimeAnalysis, RegimeClassifier(), and PopulateRegimeAnalysis() calling Parts 2β6 sequentially.
π Read | Docs | @mql5dev
β€21π2
Media is too big
VIEW IN TELEGRAM
In June, MetaQuotes participated as a Gold Sponsor at iFX EXPO International 2026, in Limassol, one of the major international events.
At the exhibition, we recorded a series of short interviews with representatives of brokerage companies.
They shared their experience using MetaQuotes solutions, discussed the evolution of MetaTrader 5 and new products in the ecosystem, and highlighted the opportunities these technologies create for modern brokerage businesses.
β’ Ultency β a liquidity aggregation and order matching engine integrated with MetaTrader 5
β’ metatrader.com β a new portal offering financial news, market analysis, trading ideas, educational content, and algorithmic trading tools
β’ MetaTrader Access Servers β a global network of access servers ensuring fast and stable connections to the trading platform for traders worldwide
β’ Integrated payments, enabling traders to fund their accounts directly from MetaTrader
Discuss the video:
π MQL5.community for traders
π MetaQuotes official YouTube channel
At the exhibition, we recorded a series of short interviews with representatives of brokerage companies.
They shared their experience using MetaQuotes solutions, discussed the evolution of MetaTrader 5 and new products in the ecosystem, and highlighted the opportunities these technologies create for modern brokerage businesses.
β’ Ultency β a liquidity aggregation and order matching engine integrated with MetaTrader 5
β’ metatrader.com β a new portal offering financial news, market analysis, trading ideas, educational content, and algorithmic trading tools
β’ MetaTrader Access Servers β a global network of access servers ensuring fast and stable connections to the trading platform for traders worldwide
β’ Integrated payments, enabling traders to fund their accounts directly from MetaTrader
Discuss the video:
π MQL5.community for traders
π MetaQuotes official YouTube channel
β€27π₯4π4π2π2
John F. Ehlers treats price as a signal with frequency components, not a chart pattern. The focus is a practical MQL5 DSP library that ports published coefficients and formulas, with indicators and an EA sharing identical code paths.
Core point: smoothing is filtering. The SMA is a weak low-pass filter: material lag plus a poor frequency response that leaks noise. A 2-pole IIR design reduces noise with less delay.
Library design uses stateful recursive filters with explicit history, warm-up handling, and a single include file as the source of truth. No iCustom dependency for the EA.
Implemented tools: Super Smoother (2-pole low-pass), Roofing Filter (2-pole high-pass cascaded into Super Smoother to isolate a tradeable band), and Even Better Sinewave, which flags non-cycling regimes by sustained railing near Β±1.
π Read | CodeBase | @mql5dev
Core point: smoothing is filtering. The SMA is a weak low-pass filter: material lag plus a poor frequency response that leaks noise. A 2-pole IIR design reduces noise with less delay.
Library design uses stateful recursive filters with explicit history, warm-up handling, and a single include file as the source of truth. No iCustom dependency for the EA.
Implemented tools: Super Smoother (2-pole low-pass), Roofing Filter (2-pole high-pass cascaded into Super Smoother to isolate a tradeable band), and Even Better Sinewave, which flags non-cycling regimes by sustained railing near Β±1.
π Read | CodeBase | @mql5dev
β€28π4
Part 7 finalizes the MMAR libraryβs generative stack by adding CMonteCarlo, a thin orchestration layer that turns a single simulated path into a volatility forecast distribution.
The class initializes with fitted multifractal parameters, runs N independent MMAR simulations over a chosen horizon, and aggregates per-path volatilities into mean, median, standard deviation, and a percentile-based 95% confidence interval. Raw per-run outputs remain accessible for custom diagnostics.
Key implementation details include adaptive cascade depth (choosing the smallest b^k that covers the horizon), clean per-trial engine instantiation, and resilient failure handling that skips rare FBM factorization issues without aborting the run.
A full EURUSD M10 pipeline completes in ~1.3s for 100 simulations, making periodic EA recalibration practical without running o...
π Read | Signals | @mql5dev
The class initializes with fitted multifractal parameters, runs N independent MMAR simulations over a chosen horizon, and aggregates per-path volatilities into mean, median, standard deviation, and a percentile-based 95% confidence interval. Raw per-run outputs remain accessible for custom diagnostics.
Key implementation details include adaptive cascade depth (choosing the smallest b^k that covers the horizon), clean per-trial engine instantiation, and resilient failure handling that skips rare FBM factorization issues without aborting the run.
A full EURUSD M10 pipeline completes in ~1.3s for 100 simulations, making periodic EA recalibration practical without running o...
π Read | Signals | @mql5dev
β€27π4
Algorithmic trading keeps running into the same constraint: higher model complexity improves backtests while increasing overfitting risk, and non-stationary markets invalidate static patterns. Full retraining also amplifies catastrophic forgetting, forcing a tradeoff between stability and adaptability.
Quantum Reservoir Computing (QRC) addresses this by keeping the reservoir fixed and training only the output layer. A four-qubit circuit maps features into a 16-state space via qubit rotations, relying on quantum nonlinearity and feature coupling.
The implementation uses Monte Carlo approximation, a 1000-sample experience buffer with decay, online plus batch updates, and adaptive learning rates. Tests on EURUSD M15 (2017β2025) reported +USD 505 on 0.01 lots from USD 1,000, Sharpe 1.22, win rate 82%, with strong sensitivity to data artifacts and news...
π Read | CodeBase | @mql5dev
Quantum Reservoir Computing (QRC) addresses this by keeping the reservoir fixed and training only the output layer. A four-qubit circuit maps features into a 16-state space via qubit rotations, relying on quantum nonlinearity and feature coupling.
The implementation uses Monte Carlo approximation, a 1000-sample experience buffer with decay, online plus batch updates, and adaptive learning rates. Tests on EURUSD M15 (2017β2025) reported +USD 505 on 0.01 lots from USD 1,000, Sharpe 1.22, win rate 82%, with strong sensitivity to data artifacts and news...
π Read | CodeBase | @mql5dev
β€29β‘4π2β1π1
The article shows why moving MT5/MQL projects from βcode + ZIP attachmentβ to MQL Algo Forge becomes necessary once libraries evolve across many articles. Git-backed history removes the pain of repackaging archives, comparing versions, and supporting users with unclear change sets.
A practical workflow emerges: start projects in Shared Projects, choose a project type for executables or use empty projects for multi-file or mixed outputs, then commit frequently. For older libraries, import versions sequentially and create Releases (stable/beta) so readers can target exact published states.
Key pitfall: Algo Forge reliably tracks diffs only for UTF-8 files; MetaEditor may save as Unicode, causing files to be treated as binary and hiding history. Documentation matters too: meaningful commit messages and a clear README.md turn a repository from a file dump into m...
π Read | Freelance | @mql5dev
A practical workflow emerges: start projects in Shared Projects, choose a project type for executables or use empty projects for multi-file or mixed outputs, then commit frequently. For older libraries, import versions sequentially and create Releases (stable/beta) so readers can target exact published states.
Key pitfall: Algo Forge reliably tracks diffs only for UTF-8 files; MetaEditor may save as Unicode, causing files to be treated as binary and hiding history. Documentation matters too: meaningful commit messages and a clear README.md turn a repository from a file dump into m...
π Read | Freelance | @mql5dev
β€37π5π3π₯1π1
An updated MQL5 implementation of the Shved Supply and Demand indicator is available with multi-timeframe support and a history review mode.
Zones are calculated using fractals and ATR, then rendered on the chart for a selectable timeframe independent of the current chart. Zone states include weak, untested, verified, proven, and broken (broken state not used for weak zones). These classifications reflect whether price has retested and failed to break a level multiple times.
History mode can be enabled by setting the historyMode parameter to true, then double-clicking a point on the chart to display support/resistance zones for that moment.
Recent revisions address compile warnings, low-bar edge cases, alignment with the MT4 version, corrected labels in history mode, and an optional mobile notification when price enters a zone.
π Read | Signals | @mql5dev
Zones are calculated using fractals and ATR, then rendered on the chart for a selectable timeframe independent of the current chart. Zone states include weak, untested, verified, proven, and broken (broken state not used for weak zones). These classifications reflect whether price has retested and failed to break a level multiple times.
History mode can be enabled by setting the historyMode parameter to true, then double-clicking a point on the chart to display support/resistance zones for that moment.
Recent revisions address compile warnings, low-bar edge cases, alignment with the MT4 version, corrected labels in history mode, and an optional mobile notification when price enters a zone.
π Read | Signals | @mql5dev
β€28π3π1
Duelist Algorithm (DA) is a population-based optimizer proposed in 2015 by Biyantoβs group to reduce reliance on blind mutation and crossover. The model separates roles: losers copy parts of winners, winners apply controlled innovation, and top champions spawn new candidates while skipping duels.
An MQL5 implementation can be structured as C_AO_DA_duelist with parameters for population size, luckCoefficient, learningProbability, innovationProbability, and championsCount. Core steps: initialize population on a discrete grid, select champions, run randomized duels with a luck term, apply learning to losers, mutate winners, retrain from champions, sort by fitness, and cull to fixed size.
Benchmarks on Hilly, Forest, and Megacity functions (10,000 runs) produced an overall score of 4.34477 (48.28%). DA ranked 42nd among tested methods, with low disper...
π Read | NeuroBook | @mql5dev
An MQL5 implementation can be structured as C_AO_DA_duelist with parameters for population size, luckCoefficient, learningProbability, innovationProbability, and championsCount. Core steps: initialize population on a discrete grid, select champions, run randomized duels with a luck term, apply learning to losers, mutate winners, retrain from champions, sort by fitness, and cull to fixed size.
Benchmarks on Hilly, Forest, and Megacity functions (10,000 runs) produced an overall score of 4.34477 (48.28%). DA ranked 42nd among tested methods, with low disper...
π Read | NeuroBook | @mql5dev
β€23β‘5π2π2
MetaTrader 5 lacks a native volume profile, but a session-based implementation can be built entirely in MQL5 using CopyTicksRange() plus standard chart objects. The indicator pulls ticks for a defined London/New York/custom window, bins prices into a histogram, then derives POC and the 70% Value Area (VAH/VAL) by expanding outward from the highest-volume bin.
A key implementation detail for FX/CFDs: real volume fields are often zero, so tick filtering must rely on non-zero bid/ask, with each tick weighted as 1 to form a tick-density profile.
The design is modular: session rollover detection, tick collection, histogram building, POC/Value Area calculation, and renderer. Complexity stays linear in ticks, with far fewer bins than ticks in practice.
π Read | Docs | @mql5dev
A key implementation detail for FX/CFDs: real volume fields are often zero, so tick filtering must rely on non-zero bid/ask, with each tick weighted as 1 to form a tick-density profile.
The design is modular: session rollover detection, tick collection, histogram building, POC/Value Area calculation, and renderer. Complexity stays linear in ticks, with far fewer bins than ticks in practice.
π Read | Docs | @mql5dev
β€27π2
This article extends the MQL5 Wizard trailing-stop toolkit with a dual-engine model designed for fast, whipsawed βZ-typeβ markets where classic trailing stops overreact to every tick.
Engine 1 is a Hampel-style sliding window median with MAD, treating recent prices as a distribution and rejecting wick-like anomalies so stop updates follow βrealβ movement instead of transient spikes. Bollinger Band width can scale the rejection threshold to match volatility.
Engine 2 adds directional context via a BiLSTM that reads the same window forward and backward to produce a bounded trend score, allowing the stop to tighten aggressively when momentum is real, but stay stable during noise.
π Read | Signals | @mql5dev
Engine 1 is a Hampel-style sliding window median with MAD, treating recent prices as a distribution and rejecting wick-like anomalies so stop updates follow βrealβ movement instead of transient spikes. Bollinger Band width can scale the rejection threshold to match volatility.
Engine 2 adds directional context via a BiLSTM that reads the same window forward and backward to produce a bounded trend score, allowing the stop to tighten aggressively when momentum is real, but stay stable during noise.
π Read | Signals | @mql5dev
β€24π2π2
Forward Simulation Engine for MetaTrader 5 has been extended from a static EMA-crossover projection into a live, self-updating forward sequence.
A calibration layer now samples recent closed bars to compute average body and wick sizes. Projections reuse these metrics so candle dimensions align with the current symbol/timeframe volatility, while EMA slope remains a momentum scaler.
Prediction adds a sine envelope plus decay for body sizing, proportional wicks via wick-to-body ratios, and periodic reduced counter-trend candles. Rendering keeps object-based bodies and wicks, supports configurable spacing, and advances on each bar close by deleting the oldest projected candle to stay one bar ahead.
Implementation details include modular signal/prediction/renderer separation, OnCalculate-driven updates, optional manual anchor control via OnTimer, pip-distance ...
π Read | AlgoBook | @mql5dev
A calibration layer now samples recent closed bars to compute average body and wick sizes. Projections reuse these metrics so candle dimensions align with the current symbol/timeframe volatility, while EMA slope remains a momentum scaler.
Prediction adds a sine envelope plus decay for body sizing, proportional wicks via wick-to-body ratios, and periodic reduced counter-trend candles. Rendering keeps object-based bodies and wicks, supports configurable spacing, and advances on each bar close by deleting the oldest projected candle to stay one bar ahead.
Implementation details include modular signal/prediction/renderer separation, OnCalculate-driven updates, optional manual anchor control via OnTimer, pip-distance ...
π Read | AlgoBook | @mql5dev
β€27π3π3
Dream Optimization Algorithm (DOA) adapts a βsleep cycleβ model for parameter tuning in trading systems, aiming to keep exploration strong while still converging reliably in non-stationary markets.
The population is split into groups with different βmemory styles.β Each iteration begins by pulling agents back to the current group-best (partial retention), then applies either selective forgetting or βdream sharing.β Forgetting changes k randomly chosen dimensions using cosine-modulated steps that start large and shrink over time; dream sharing copies k dimensions from another agent to spread useful traits.
DOA runs almost entirely in exploration, then switches to a short exploitation phase where all agents reset to the global best and perform small cosine-damped refinements. The MQL5 implementation wraps this as a reusable optimizer class with clear phase co...
π Read | Signals | @mql5dev
The population is split into groups with different βmemory styles.β Each iteration begins by pulling agents back to the current group-best (partial retention), then applies either selective forgetting or βdream sharing.β Forgetting changes k randomly chosen dimensions using cosine-modulated steps that start large and shrink over time; dream sharing copies k dimensions from another agent to spread useful traits.
DOA runs almost entirely in exploration, then switches to a short exploitation phase where all agents reset to the global best and perform small cosine-damped refinements. The MQL5 implementation wraps this as a reusable optimizer class with clear phase co...
π Read | Signals | @mql5dev
β€23π1
This MQL5 indicator turns market structure from manual chart reading into a deterministic, testable pipeline. It detects major external swings (S1βS4) with explicit swing-high/low functions, then refines true extremes between anchors to produce stable EXH/EXL levels and validate bullish/bearish sequences.
Once the external leg is confirmed, it scans inside that range with a smaller lookback to find the first internal shift (IH β IL β CHoCH/BOS). That first valid break becomes a complete trade blueprint: entry marker, stop at the internal low/high, and take profit projected at 1.5R.
Implementation favors reproducibility: runs once per new bar, avoids out-of-range scans, draws via chart objects with a strict prefix, prevents duplicates, and redraws only when needed for performance and clean cleanup.
π Read | AlgoBook | @mql5dev
Once the external leg is confirmed, it scans inside that range with a smaller lookback to find the first internal shift (IH β IL β CHoCH/BOS). That first valid break becomes a complete trade blueprint: entry marker, stop at the internal low/high, and take profit projected at 1.5R.
Implementation favors reproducibility: runs once per new bar, avoids out-of-range scans, draws via chart objects with a strict prefix, prevents duplicates, and redraws only when needed for performance and clean cleanup.
π Read | AlgoBook | @mql5dev
β€38π5β‘3π2π2