A recurring failure mode in ML trading shows up again: out-of-sample direction accuracy above 60% can still produce weak or negative PnL once spreads, swaps, slippage, and regime shifts are included.
Version updates improved dataset quality via strict UP/DOWN balancing, richer features (ATR/RSI/Bollinger position), and structured fine-tuning examples. These steps raise predictive consistency but do not align labels with profit.
Key issues remain: forced binary outputs remove the βno tradeβ state; confidence tied to move magnitude does not map to expectancy after costs; parsers with hard fallbacks can introduce systematic bias; backtests with few trades and no costs inflate results.
Next iteration needs profit-based targets (LONG/SHORT/FLAT or expected PnL), cost-aware validation, and evaluation by trading metrics rather than accuracy.
π Read | CodeBase | @mql5dev
Version updates improved dataset quality via strict UP/DOWN balancing, richer features (ATR/RSI/Bollinger position), and structured fine-tuning examples. These steps raise predictive consistency but do not align labels with profit.
Key issues remain: forced binary outputs remove the βno tradeβ state; confidence tied to move magnitude does not map to expectancy after costs; parsers with hard fallbacks can introduce systematic bias; backtests with few trades and no costs inflate results.
Next iteration needs profit-based targets (LONG/SHORT/FLAT or expected PnL), cost-aware validation, and evaluation by trading metrics rather than accuracy.
π Read | CodeBase | @mql5dev
π13π€©8β€4π₯4β‘1
Finite differences provide a discrete approximation of derivatives and align naturally with price series sampled in bars and ticks. First and higher-order differences can be chained to characterize momentum and curvature without assuming continuity.
A binomial transform built from successive differences can be inverted after attenuating higher orders, producing a practical smoothing and noise-reduction pipeline with explicit control over how noise scales by order.
Differences also support pattern encoding by quantizing D differences into L levels, then mapping level indices into a pattern ID for statistics-based forecasts. Similar logic applies to OHLC candlestick structure using derived differences, extending to multi-candle sequences.
Forecasting options include naive models (SMA shift, average rate-of-change), higher-order extrapolation, adapti...
π Read | Calendar | @mql5dev
A binomial transform built from successive differences can be inverted after attenuating higher orders, producing a practical smoothing and noise-reduction pipeline with explicit control over how noise scales by order.
Differences also support pattern encoding by quantizing D differences into L levels, then mapping level indices into a pattern ID for statistics-based forecasts. Similar logic applies to OHLC candlestick structure using derived differences, extending to multi-candle sequences.
Forecasting options include naive models (SMA shift, average rate-of-change), higher-order extrapolation, adapti...
π Read | Calendar | @mql5dev
β€15π15π€©4π₯3
APB Channel EA implements a two-step entry for XAUUSD/XAGUSD using Heikin-Ashi reversal detection plus a Keltner-style EMA/ATR channel confirmation. Logic executes once per closed bar and starts with a Heikin-Ashi colour flip that arms a pending direction.
A trade is only permitted after a re-entry trigger: buy requires a close at/above the lower band, sell requires a close at/below the upper band. The pending signal expires after MaxBarsToTrigger bars unless set to 0.
Before order placement, time-window, tick-volume ratio, and ATR-based volatility filters must all pass. Position sizing targets constant monetary risk using entry-to-stop distance, with TP at RR_Ratio.
Stops are structural (recent swing high/low plus buffer), with optional break-even and an immediate exit on an opposite Heikin-Ashi arrow. Correct PointsPerPip configuration is critical for al...
π Read | AlgoBook | @mql5dev
A trade is only permitted after a re-entry trigger: buy requires a close at/above the lower band, sell requires a close at/below the upper band. The pending signal expires after MaxBarsToTrigger bars unless set to 0.
Before order placement, time-window, tick-volume ratio, and ATR-based volatility filters must all pass. Position sizing targets constant monetary risk using entry-to-stop distance, with TP at RR_Ratio.
Stops are structural (recent swing high/low plus buffer), with optional break-even and an immediate exit on an opposite Heikin-Ashi arrow. Correct PointsPerPip configuration is critical for al...
π Read | AlgoBook | @mql5dev
β€19π8π€©8π₯4
Multivariate time series fail when models treat each series in isolation. Cross-asset dependencies are time-varying, often driven by macro events, and dense correlation graphs become unstable at scale.
Adaptive-weight GNNs learn the graph from data, but an NΓN adjacency matrix is expensive and tends to include weak, misleading links. SAGDFN addresses this with graph diffusion and spatial sparsity.
The framework samples significant nodes via Significant Neighbors Sampling and refines edges using Sparse Spatial Multi-Head Attention with Ξ±-Entmax for sparse weights. This compresses adjacency to NΓM, reducing complexity from NΒ² to MN and lowering memory pressure.
Use cases include large-universe forecasting, portfolio rebalancing, and low-latency multi-instrument trading during volatile regimes.
π Read | Calendar | @mql5dev
Adaptive-weight GNNs learn the graph from data, but an NΓN adjacency matrix is expensive and tends to include weak, misleading links. SAGDFN addresses this with graph diffusion and spatial sparsity.
The framework samples significant nodes via Significant Neighbors Sampling and refines edges using Sparse Spatial Multi-Head Attention with Ξ±-Entmax for sparse weights. This compresses adjacency to NΓM, reducing complexity from NΒ² to MN and lowering memory pressure.
Use cases include large-universe forecasting, portfolio rebalancing, and low-latency multi-instrument trading during volatile regimes.
π Read | Calendar | @mql5dev
β€9π3π2π2π₯1
This part moves the replay system from chart playback to full trade-flow simulation by modeling server behavior inside MT5.
A lightweight SQL database becomes the shared state for orders and positions, letting the EA, indicators, and helper components stay consistent in both live trading and replay mode. Instead of duplicating code, the existing C_Orders class is extended via database inheritance, creates a single-table schema, and routes requests to either the real server or a simulator based on the symbol.
The simulator replays server-side trade events by dispatching OnTradeTransaction in the correct order, enabling repeated market orders and later pending-order support. Initial coverage targets only the required actions (DEAL and SLTP), with SL/TP implemented as a direct DB update plus a synthesized transaction response.
π Read | Signals | @mql5dev
A lightweight SQL database becomes the shared state for orders and positions, letting the EA, indicators, and helper components stay consistent in both live trading and replay mode. Instead of duplicating code, the existing C_Orders class is extended via database inheritance, creates a single-table schema, and routes requests to either the real server or a simulator based on the symbol.
The simulator replays server-side trade events by dispatching OnTradeTransaction in the correct order, enabling repeated market orders and later pending-order support. Initial coverage targets only the required actions (DEAL and SLTP), with SL/TP implemented as a direct DB update plus a synthesized transaction response.
π Read | Signals | @mql5dev
β€10β‘4π2π₯2π€©2π1
This article closes out core operator overloading in MQL5 by showing why [] rarely stands alone: indexed access typically requires a matching operator= to support both reads and writes.
It walks through common compiler errors, especially returning references to private members (breaking encapsulation) and assignments the compiler canβt resolve. The key is understanding how the compiler rewrites obj[i] into operator[] calls, often producing a temporary that changes assignment behavior.
Practical examples demonstrate single vs chained assignments, ambiguity when multiple operator= overloads exist (fixed with explicit casts), and applying [] to a doubly linked list to make list access feel array-likeβwhile preserving correctness and maintainability for trading code.
π Read | CodeBase | @mql5dev
It walks through common compiler errors, especially returning references to private members (breaking encapsulation) and assignments the compiler canβt resolve. The key is understanding how the compiler rewrites obj[i] into operator[] calls, often producing a temporary that changes assignment behavior.
Practical examples demonstrate single vs chained assignments, ambiguity when multiple operator= overloads exist (fixed with explicit casts), and applying [] to a doubly linked list to make list access feel array-likeβwhile preserving correctness and maintainability for trading code.
π Read | CodeBase | @mql5dev
β€7π1π€©1
In MetaTrader 5 build 6230, we have significantly expanded the capabilities of AI Assistant for interacting with the platform. New tools have been added for working with Expert Advisors, scripts, and indicators, preparing parameters before testing, and retrieving Economic Calendar data.
The agent can now independently perform even more complex sequences of actions β from preparing a trading robot for testing to analyzing the market in the context of macroeconomic events.
For developers, MQL5 capabilities have also been expanded. Vectors and matrices now feature a new sorting method, while complex matrices and vectors support additional mathematical operations, including products and methods for solving systems of equations. A Print method has also been added for matrices.
In addition, a number of issues related to interface rendering, chart operation, and connections to trading accounts have been fixed in the desktop and web terminals.
Read more...
The agent can now independently perform even more complex sequences of actions β from preparing a trading robot for testing to analyzing the market in the context of macroeconomic events.
For developers, MQL5 capabilities have also been expanded. Vectors and matrices now feature a new sorting method, while complex matrices and vectors support additional mathematical operations, including products and methods for solving systems of equations. A Print method has also been added for matrices.
In addition, a number of issues related to interface rendering, chart operation, and connections to trading accounts have been fixed in the desktop and web terminals.
Read more...
β€18π6π2π¨βπ»1
Bitmap-based CCanvas UIs in MQL5 suffer from startup overhead, blurred scaling, and theme duplication. This article replaces embedded .bmp resources with a procedural vector icon system that renders crisp at any size and recolors directly from the active palette.
The core is a small set of anti-aliased primitives (strokes, discs, rings, rounded rectangles, and polygons) using per-pixel coverage blending. Complex icons are then composed from these primitives using fractional positioning, keeping proportions consistent across header/sidebar sizes.
Logos and glyphs (MQL5 wordmark, layered orb, X, sun/moon, search, new chat, clear, history, toggle) are wired into existing render functions via icon IDs, removing all image-loading and resize code. Practical gains: simpler distribution, cleaner visuals, and reliable light/dark/hover rendering without extra assets.
π Read | AlgoBook | @mql5dev
The core is a small set of anti-aliased primitives (strokes, discs, rings, rounded rectangles, and polygons) using per-pixel coverage blending. Complex icons are then composed from these primitives using fractional positioning, keeping proportions consistent across header/sidebar sizes.
Logos and glyphs (MQL5 wordmark, layered orb, X, sun/moon, search, new chat, clear, history, toggle) are wired into existing render functions via icon IDs, removing all image-loading and resize code. Practical gains: simpler distribution, cleaner visuals, and reliable light/dark/hover rendering without extra assets.
π Read | AlgoBook | @mql5dev
β€15π₯3
An adaptive Fibonacci volatility band indicator for MT5 replaces fixed offsets with volatility-aware distances. It centers bands on a smoothed moving average of the chosen price and scales band width with a smoothed ATR, so levels expand in fast markets and contract in quiet ones.
Implementation focuses on clean MQL5 structure: multiple plot/buffer mappings for three upper/lower Fibonacci levels, a direction-colored middle line, and filled outer zones. Data handling uses an ATR(200) handle, CopyBuffer(), lookback limits, warm-up logic for SMMA initialization via an initial SMA, and incremental recalculation to stay efficient.
Result: dynamic volatility zones that help spot evolving support/resistance and provide a solid base for strategy rules and further indicator work.
π Read | AlgoBook | @mql5dev
Implementation focuses on clean MQL5 structure: multiple plot/buffer mappings for three upper/lower Fibonacci levels, a direction-colored middle line, and filled outer zones. Data handling uses an ATR(200) handle, CopyBuffer(), lookback limits, warm-up logic for SMMA initialization via an initial SMA, and incremental recalculation to stay efficient.
Result: dynamic volatility zones that help spot evolving support/resistance and provide a solid base for strategy rules and further indicator work.
π Read | AlgoBook | @mql5dev
β€15π3π1π€©1π¨βπ»1π1
StrategyTester5 targets a common MT5 Python workflow issue: live trading uses the MetaTrader5 package, while backtesting often requires a separate tester API and duplicated strategy logic.
The framework adds VirtualMetaTrader5, a shadow implementation that mirrors MT5 methods, constants, and properties, caching terminal/account/symbol state for simulation use.
A single mt5 variable swap switches environments, keeping one EA-style main() / on_tick callback for both live execution and historical replay.
Backtests run via run_backtesting(), which handles data prep, modeling modes (ticks/open/1m OHLC), optional Flask-SocketIO dashboard, and a lighter optimization mode.
Results return as a TesterStats object with MT5-style metrics. Historical inputs can come from parquet via HistoryManager or optionally from the terminal to reduce file I/O overhead.
π Read | Signals | @mql5dev
The framework adds VirtualMetaTrader5, a shadow implementation that mirrors MT5 methods, constants, and properties, caching terminal/account/symbol state for simulation use.
A single mt5 variable swap switches environments, keeping one EA-style main() / on_tick callback for both live execution and historical replay.
Backtests run via run_backtesting(), which handles data prep, modeling modes (ticks/open/1m OHLC), optional Flask-SocketIO dashboard, and a lighter optimization mode.
Results return as a TesterStats object with MT5-style metrics. Historical inputs can come from parquet via HistoryManager or optionally from the terminal to reduce file I/O overhead.
π Read | Signals | @mql5dev
β€12π₯4π1π€―1
This part advances an automated MT5 optimization pipeline that stores sequential Strategy Tester jobs in an SQLite database, turning manual multi-currency EA research into repeatable projects. The βproject creationβ EA behaves like a script: it generates stage-specific tasks, writes them to the DB, then exits.
Focus shifts to stage 2: combining top stage-1 passes into strategy groups and re-optimizing them with a chosen criterion (often a custom normalized annual profit) and an optional time cap to cut wasted tester runtime.
Key controls include filters on minimum custom metric, trade count, and Sharpe ratio, plus group size (2β16). The article also shows why iterative dry runs matter: a detected bug and missing symbol history can mark tasks βdoneβ while preventing the pipeline from producing the final EA, so DB inspection becomes part of debugging.
π Read | Signals | @mql5dev
Focus shifts to stage 2: combining top stage-1 passes into strategy groups and re-optimizing them with a chosen criterion (often a custom normalized annual profit) and an optional time cap to cut wasted tester runtime.
Key controls include filters on minimum custom metric, trade count, and Sharpe ratio, plus group size (2β16). The article also shows why iterative dry runs matter: a detected bug and missing symbol history can mark tasks βdoneβ while preventing the pipeline from producing the final EA, so DB inspection becomes part of debugging.
π Read | Signals | @mql5dev
β€10π₯1