This article removes the usual βtranslation taxβ when streaming MetaTrader 5 tick batches into Python by writing ticks directly in Apache Arrowβs columnar memory layout inside Windows shared memory. Instead of serializing rows and unpacking fields into Python objects, the reader can import the same buffers as an Arrow RecordBatch with zero deserialization.
On the MT5 side, ArrowBufferWriter.mqh builds 64-byte aligned validity/data buffers for six tick columns and publishes them via a double-buffered seqlock (odd/even generation counter) to guarantee consistent reads without mutexes. No pointers are shared; both sides recompute offsets from a fixed schema contract.
An EA batches ticks by size or timeout and flushes with a small, bounded set of memory copies per batch. A self-test script validates byte-level correctness before adding the Python reader...
π Read | Forum | @mql5dev
On the MT5 side, ArrowBufferWriter.mqh builds 64-byte aligned validity/data buffers for six tick columns and publishes them via a double-buffered seqlock (odd/even generation counter) to guarantee consistent reads without mutexes. No pointers are shared; both sides recompute offsets from a fixed schema contract.
An EA batches ticks by size or timeout and flushes with a small, bounded set of memory copies per batch. A self-test script validates byte-level correctness before adding the Python reader...
π Read | Forum | @mql5dev
π12β€9π€©1π1
Engineering workflow for suppressing noise in lagged MA features and converting regime structure into a deployable, risk-aware MQL5 system.
Pipeline uses MA lags, ICA embedding, and a linear classifier. Two issues surfaced: unstable out-of-sample gains and non-deployable spectral clustering due to skl2onnx limits.
Fixes include time-series CV for ICA tuning, a cluster-count search with a peak at 8 regimes, and a supervised surrogate to predict spectral regimes for ONNX export.
Validation highlights a common failure: per-cluster accuracy on one-hot labels is reward-hackable by predicting zeros. Joint accuracy and class-share checks are required.
MQL5 integration loads three ONNX models and applies regime-conditioned position sizing and stop width using expected return and risk per cluster, then backtests on the last three years with tick-accurate sett...
π Read | AppStore | @mql5dev
Pipeline uses MA lags, ICA embedding, and a linear classifier. Two issues surfaced: unstable out-of-sample gains and non-deployable spectral clustering due to skl2onnx limits.
Fixes include time-series CV for ICA tuning, a cluster-count search with a peak at 8 regimes, and a supervised surrogate to predict spectral regimes for ONNX export.
Validation highlights a common failure: per-cluster accuracy on one-hot labels is reward-hackable by predicting zeros. Joint accuracy and class-share checks are required.
MQL5 integration loads three ONNX models and applies regime-conditioned position sizing and stop width using expected return and risk per cluster, then backtests on the last three years with tick-accurate sett...
π Read | AppStore | @mql5dev
β€11π7π₯2π2π€©1
Part 2 connects dynamic risk-budget computation to position sizing via WParamCalibrator.
The calibrator converts risk_budget_pct into a sigmoid w parameter, then PropFirmAwareSizer scales positions smoothly from full size to zero as the daily budget erodes. The sizing logic remains independent of the specific prop-firm rule set.
A sigmoid is used to avoid threshold discontinuities that cause abrupt sizing shutdowns and unstable behavior in path-dependent strategies. The chain computes cal_bet_size = (risk_budget_pct * safety_factor) / stop_loss_pct, then numerically inverts the sigmoid to get w. The 0.98 cap and 0.02 floor are arithmetic guards, not business rules.
Default parameters create a long flat sizing ceiling until roughly 1.4% budget remains, concentrating de-risking late. This requires strategy-specific tuning and backtesting.
A product...
π Read | Docs | @mql5dev
The calibrator converts risk_budget_pct into a sigmoid w parameter, then PropFirmAwareSizer scales positions smoothly from full size to zero as the daily budget erodes. The sizing logic remains independent of the specific prop-firm rule set.
A sigmoid is used to avoid threshold discontinuities that cause abrupt sizing shutdowns and unstable behavior in path-dependent strategies. The chain computes cal_bet_size = (risk_budget_pct * safety_factor) / stop_loss_pct, then numerically inverts the sigmoid to get w. The 0.98 cap and 0.02 floor are arithmetic guards, not business rules.
Default parameters create a long flat sizing ceiling until roughly 1.4% budget remains, concentrating de-risking late. This requires strategy-specific tuning and backtesting.
A product...
π Read | Docs | @mql5dev
β€12π5π2
The article completes a doubly linked list in MQL5 by adding safe deletion and insertion in the middle, avoiding array-style shifting and extra copying. The core technique is pointer rewiring: link a nodeβs prev directly to its next (and vice versa), then free the removed node.
Deletion evolves from value-based search to index-based removal, with a maintained element count to validate bounds and handle head/tail as fast paths. A further refinement accepts negative indexes to traverse from the end, requiring direction-aware pointer updates to prevent deleting the wrong node.
These patterns matter when building MT5 tools that process large, frequently changing datasets, such as order/price event buffers, where predictable runtime and minimal memory churn are critical.
π Read | VPS | @mql5dev
Deletion evolves from value-based search to index-based removal, with a maintained element count to validate bounds and handle head/tail as fast paths. A further refinement accepts negative indexes to traverse from the end, requiring direction-aware pointer updates to prevent deleting the wrong node.
These patterns matter when building MT5 tools that process large, frequently changing datasets, such as order/price event buffers, where predictable runtime and minimal memory churn are critical.
π Read | VPS | @mql5dev
β€20π8π2
The MVC table library for MT5 is extended with a vertical header, enabling row-aware layouts where both axes carry meaningful labels. The example builds a symmetric symbol correlation matrix: row/column headers show symbols, cells show correlation values.
Rendering is improved with three-point color interpolation for coefficients in [-1..+1], so each cell can be shaded consistently based on correlation strength and sign. Cells now support their own background color instead of inheriting the row color.
Interaction handling is refined: hover/click can operate at cell level without row flicker, and events report the selected row/column plus header texts. Header classes are refactored into a common base with specialized column/row variants, and column headers can emit sortable-click events. Subwindow sizing is handled to keep cursor tracking correct afte...
π Read | VPS | @mql5dev
Rendering is improved with three-point color interpolation for coefficients in [-1..+1], so each cell can be shaded consistently based on correlation strength and sign. Cells now support their own background color instead of inheriting the row color.
Interaction handling is refined: hover/click can operate at cell level without row flicker, and events report the selected row/column plus header texts. Header classes are refactored into a common base with specialized column/row variants, and column headers can emit sortable-click events. Subwindow sizing is handled to keep cursor tracking correct afte...
π Read | VPS | @mql5dev
β€11π3π2
Replay/simulation UI updates for MQL5 position indicators.
A chart-only long/short cue is added when SL and TP are absent. C_ElementsTrade gains a direction object; CreateInfoDirect builds a Wingdings glyph via CharArrayToString from a ushort array, selecting code 236 or 238 based on a constructor flag. C_IndicatorPosition is adjusted to pass position direction with minimal edits.
Interaction safety is tightened for SL/TP dragging. DispatchMessage now signals the mouse indicator to hide the horizontal line during move mode and restore it after selection. Follow-up changes route the active price into UpdateViewPort, enabling an auxiliary line and synchronized movement of related controls while waiting for server confirmation.
π Read | Freelance | @mql5dev
A chart-only long/short cue is added when SL and TP are absent. C_ElementsTrade gains a direction object; CreateInfoDirect builds a Wingdings glyph via CharArrayToString from a ushort array, selecting code 236 or 238 based on a constructor flag. C_IndicatorPosition is adjusted to pass position direction with minimal edits.
Interaction safety is tightened for SL/TP dragging. DispatchMessage now signals the mouse indicator to hide the horizontal line during move mode and restore it after selection. Follow-up changes route the active price into UpdateViewPort, enabling an auxiliary line and synchronized movement of related controls while waiting for server confirmation.
π Read | Freelance | @mql5dev
β€19π5π2π¨βπ»2π€©1
SCNN splits a time series into long-term, seasonal, short-term, coupled, and residual components, training each path separately. This improves auditability versus monolithic models and supports mixed heuristics plus neural modules.
Current implementation work focuses on the coupled component via spatially weighted normalization with attention. OpenCL kernels AdaptSpatialNorm and AdaptSpatialNormGrad compute weighted mean/variance per time step, normalize per variable, and backpropagate gradients to inputs, attention weights, and saved statistics.
A new CNeuronAdaptSpatialNorm class in MQL5 wires the forward/backward passes and builds attention from a reduced trainable tensor, its transpose, a correlation matrix, and SoftMax, while persisting mean/stddev for later graph stages.
π Read | Calendar | @mql5dev
Current implementation work focuses on the coupled component via spatially weighted normalization with attention. OpenCL kernels AdaptSpatialNorm and AdaptSpatialNormGrad compute weighted mean/variance per time step, normalize per variable, and backpropagate gradients to inputs, attention weights, and saved statistics.
A new CNeuronAdaptSpatialNorm class in MQL5 wires the forward/backward passes and builds attention from a reduced trainable tensor, its transpose, a correlation matrix, and SoftMax, while persisting mean/stddev for later graph stages.
π Read | Calendar | @mql5dev
β€14π7π₯2π2π€©2π2
Ecological Cycle Optimizer (ECO) reframes metaheuristic search as an ecosystem: 20% producers hold elite solutions, herbivores and carnivores iteratively chase better regions, and omnivores blend signals across trophic levels to reduce blind spots.
Exploration is controlled by an adaptive predation coefficient that starts aggressive for broad search, then decays toward 1 to emphasize local refinement. Target selection uses fitness-weighted sampling to keep diversity while favoring strong candidates.
A decomposition phase applies three mutation styles (best-neighborhood, distance-scaled local randomness, and time-decaying global jumps) to avoid early stagnation. Greedy revision rolls back losing moves, preserving monotonic improvement.
The MT5 implementation structures this as a configurable class with grouped agent ranges, per-iteration Moving/Revis...
π Read | Docs | @mql5dev
Exploration is controlled by an adaptive predation coefficient that starts aggressive for broad search, then decays toward 1 to emphasize local refinement. Target selection uses fitness-weighted sampling to keep diversity while favoring strong candidates.
A decomposition phase applies three mutation styles (best-neighborhood, distance-scaled local randomness, and time-decaying global jumps) to avoid early stagnation. Greedy revision rolls back losing moves, preserving monotonic improvement.
The MT5 implementation structures this as a configurable class with grouped agent ranges, per-iteration Moving/Revis...
π Read | Docs | @mql5dev
β€9π7π2π€©1
Most SMC indicators stop at annotation. They mark swings, FVGs, and liquidity lines, then leave interpretation and trade decisions to manual work. Many also repaint by confirming swings only after the fact, so historical study does not match live conditions.
A workable approach is a single analysis pipeline that produces an explicit Market Intent Score (0β100) and maps it to a small set of decision states. The same code path must run in both βindicatorβ and βexecutionβ modes, with one boolean controlling whether orders are sent.
The system uses four timeframes (default H4/H1/M15/M5) and five stages: structure, liquidity, price behavior, intent scoring, and decision/trade plan. Key implementation details include storing swing confirmation lag, separating βbrokenβ vs βsweptβ levels, pooling liquidity with ATR-scaled tolerance, and using protected hig...
π Read | Forum | @mql5dev
A workable approach is a single analysis pipeline that produces an explicit Market Intent Score (0β100) and maps it to a small set of decision states. The same code path must run in both βindicatorβ and βexecutionβ modes, with one boolean controlling whether orders are sent.
The system uses four timeframes (default H4/H1/M15/M5) and five stages: structure, liquidity, price behavior, intent scoring, and decision/trade plan. Key implementation details include storing swing confirmation lag, separating βbrokenβ vs βsweptβ levels, pooling liquidity with ATR-scaled tolerance, and using protected hig...
π Read | Forum | @mql5dev
β€17π10π3π¨βπ»3π₯2π€©2π1
A quantum-enhanced MT5 pipeline is extended with a 3D-bar module to preserve the joint structure of price, time, volume, and volatility that 2D indicators miss. M15 OHLCV for 8 FX pairs feeds three parallel feature builders (3D bars, an 8βqubit Qiskit encoder, and 33 classic indicators) before CatBoost predicts 24βhour direction, with optional Llama-based interpretation.
The Bars3D layer tackles non-stationarity by converting OHLCV into stationary, windowed features: cyclical time encoding, returns and price acceleration, volume change and acceleration, plus rolling volatility and its change, scaled to a 3β9 range. It also flags βyellow clustersβ where high price and volume volatility coincide, estimating local reversal probability.
Quantum features come from RY angle encoding with CZ entanglement on a ring, measured into entropy, dominant-state p...
π Read | Calendar | @mql5dev
The Bars3D layer tackles non-stationarity by converting OHLCV into stationary, windowed features: cyclical time encoding, returns and price acceleration, volume change and acceleration, plus rolling volatility and its change, scaled to a 3β9 range. It also flags βyellow clustersβ where high price and volume volatility coincide, estimating local reversal probability.
Quantum features come from RY angle encoding with CZ entanglement on a ring, measured into entropy, dominant-state p...
π Read | Calendar | @mql5dev
β€17π6π₯2π€©2β1β‘1π1
SCNN implementation in MQL5 reaches the assembly and test phase, focusing on the Encoderβs end-to-end data path. The model decomposes a time series into long-term, seasonal, short-term, and spatially-aware components, keeping intermediate signals interpretable.
The forward pass applies long-term normalization, seasonal transposition and period normalization, short-term extraction, and attention-based spatial normalization. Outputs plus summary statistics are concatenated without expanding means/std across time to reduce memory, then passed through projection and a Fusion block with TANH and SIGMOID convolution branches combined by element-wise multiplication.
Backpropagation mirrors this layout: gradients split across the gated convolution branches, recombine after transpose, then flow through projection and sequential deconcatenation. Normalizers...
π Read | AppStore | @mql5dev
The forward pass applies long-term normalization, seasonal transposition and period normalization, short-term extraction, and attention-based spatial normalization. Outputs plus summary statistics are concatenated without expanding means/std across time to reduce memory, then passed through projection and a Fusion block with TANH and SIGMOID convolution branches combined by element-wise multiplication.
Backpropagation mirrors this layout: gradients split across the gated convolution branches, recombine after transpose, then flow through projection and sequential deconcatenation. Normalizers...
π Read | AppStore | @mql5dev
π11β€9β‘2π€©2π1
Partial Information Decomposition (PID) is implemented in MQL5 to fix a common failure in trading feature selection: single-indicator screens miss pair-only effects (classic XOR), where each input is useless alone but powerful together. PID splits information from two sources into four atoms: redundancy, two uniques, and synergy, with internal consistency checked via co-information.
The library supports three redundancy axioms (I_min, I_MMI, I_ccs) and shows they can disagree materially, making the axiom a modeling choice rather than an implementation detail. Continuous market data is discretized into equal-frequency bins to build a compact joint count table; all entropies are computed efficiently using precomputed log lookups.
Finite-sample bias makes raw atoms nonzero even on pure noise, so the library relies on a permutation null (with block shufflin...
π Read | Signals | @mql5dev
The library supports three redundancy axioms (I_min, I_MMI, I_ccs) and shows they can disagree materially, making the axiom a modeling choice rather than an implementation detail. Continuous market data is discretized into equal-frequency bins to build a compact joint count table; all entropies are computed efficiently using precomputed log lookups.
Finite-sample bias makes raw atoms nonzero even on pure noise, so the library relies on a permutation null (with block shufflin...
π Read | Signals | @mql5dev
β€7π5π₯2π€©1π1
An MQL5 signal class is set up to test whether a neural confirmation adds measurable value to a trend-continuation ruleset on EURUSD H4. The rule engine proposes entries from ADX/DI, an HMM gates them by regime probability, and an optional GRU vetoes unless direction and confidence thresholds are met.
The HMM estimates range, trend, or high-volatility states from normalized ADX and standardized ATR/price using a 3-state Gaussian model with Baum-Welch fitting and posterior gating (>= 0.6). The GRU is regime-specific and predicts near-term direction; it must agree with the rule and exceed |output| >= 0.05.
Evaluation is framed as a three-way comparison: raw rule, HMM-gated rule, and HMM+GRU. The added complexity is justified only if rejected trades have worse expectancy and risk metrics, rather than simply reducing trade count.
π Read | AppStore | @mql5dev
The HMM estimates range, trend, or high-volatility states from normalized ADX and standardized ATR/price using a 3-state Gaussian model with Baum-Welch fitting and posterior gating (>= 0.6). The GRU is regime-specific and predicts near-term direction; it must agree with the rule and exceed |output| >= 0.05.
Evaluation is framed as a three-way comparison: raw rule, HMM-gated rule, and HMM+GRU. The added complexity is justified only if rejected trades have worse expectancy and risk metrics, rather than simply reducing trade count.
π Read | AppStore | @mql5dev
π9β€6π1
Walsh functions provide an orthogonal, lightweight alternative to sine/cosine transforms for decomposing price series into components. Symmetric terms act as smoothers, while antisymmetric terms emphasize trend, making them useful for extracting structure that common indicators often miss.
A practical approach builds probability distributions for Walsh-derived features: order-0 aligns with SMA, and order-1 (with doubled period) captures SMA change. Combining these distributions yields an expected future SMA/trend level plus an explicit uncertainty measure; large forecast error becomes a volatility/regime signal.
Two key implementation issues are addressed: periods constrained to powers of two, and repainting from windowed calculation. Periods can be scaled by integer factors, and repainting can be removed by locking values at bar close, enabling a ...
π Read | Freelance | @mql5dev
A practical approach builds probability distributions for Walsh-derived features: order-0 aligns with SMA, and order-1 (with doubled period) captures SMA change. Combining these distributions yields an expected future SMA/trend level plus an explicit uncertainty measure; large forecast error becomes a volatility/regime signal.
Two key implementation issues are addressed: periods constrained to powers of two, and repainting from windowed calculation. Periods can be scaled by integer factors, and repainting can be removed by locking values at bar close, enabling a ...
π Read | Freelance | @mql5dev
β€21π7π€©4π₯1π1π1
H1 Container MTF Boxes is a display-only MT4 indicator that maps a single H1 candle into lower timeframes on the active chart. It renders an H1 container and optional nested boxes for M30, M15, M5, and M1 candles that occur within that hour.
The H1 range can include 25%, 50%, and 75% levels. Lower timeframe boxes use a single 50% midline to reduce visual noise. AutoFollowCurrentH1 tracks the current H1 candle, or a historical H1 can be selected via H1Shift.
Visibility toggles are provided for each nested timeframe, along with controls for colors, widths, line styles, labels, and an ObjectPrefix to avoid naming collisions. M1 mode can generate many objects and may be disabled if the chart becomes crowded. Values update while candles are still forming. An EA version based on the same H1 container logic is in development.
π Read | Forum | @mql5dev
The H1 range can include 25%, 50%, and 75% levels. Lower timeframe boxes use a single 50% midline to reduce visual noise. AutoFollowCurrentH1 tracks the current H1 candle, or a historical H1 can be selected via H1Shift.
Visibility toggles are provided for each nested timeframe, along with controls for colors, widths, line styles, labels, and an ObjectPrefix to avoid naming collisions. M1 mode can generate many objects and may be disabled if the chart becomes crowded. Values update while candles are still forming. An EA version based on the same H1 container logic is in development.
π Read | Forum | @mql5dev
π10β€9π€©2π₯1π1
A CISD-based market microstructure tool is designed to flag potential turning points using ICT/SMC-style logic. It monitors consecutive delivery candles, derives reference levels from the delivery open, and confirms a Change in State of Delivery when price reclaims and closes beyond those levels.
Confirmed CISD events extend pending levels forward, then render dashed or solid lines with mid-line labels and directional entry arrows. Liquidity sweep logic marks wick expansions that run swing highs or lows and then reject, highlighting potential stop runs.
Market Structure Shift detection tracks swing breaks and annotates them with dots. Candle overlay options apply Emerald Green and Red bull/bear colors either directly or conditioned on the confirmed CISD direction.
π Read | CodeBase | @mql5dev
Confirmed CISD events extend pending levels forward, then render dashed or solid lines with mid-line labels and directional entry arrows. Liquidity sweep logic marks wick expansions that run swing highs or lows and then reject, highlighting potential stop runs.
Market Structure Shift detection tracks swing breaks and annotates them with dots. Candle overlay options apply Emerald Green and Red bull/bear colors either directly or conditioned on the confirmed CISD direction.
π Read | CodeBase | @mql5dev
β€13π6π€©4β1π₯1π1
Session Range Desk MT5 v4.01 is a source-available, educational session-range breakout EA for MT5 hedging accounts. It combines a trailing completed-bar range, ATR-banded range validation, stop-distance position sizing, and an on-chart panel. Multiple symbols can share a desk view via terminal global variables. No grid, martingale, or averaging logic is used.
At the configured start time, the EA builds a high/low range from the previous LookbackCandles bars. If the range width falls outside the Min/Max ATR multiplier band, the day is skipped. Otherwise, a touch or a bar-close breakout can place a market order with the opposite range edge as the stop. Optional management supports fixed R targets, break-even, and partial closes, with one intended entry per symbol per server day.
Risk controls include RiskPercent sizing and a MaxDailyRiskPct desk threshold, wh...
π Read | Forum | @mql5dev
At the configured start time, the EA builds a high/low range from the previous LookbackCandles bars. If the range width falls outside the Min/Max ATR multiplier band, the day is skipped. Otherwise, a touch or a bar-close breakout can place a market order with the opposite range edge as the stop. Optional management supports fixed R targets, break-even, and partial closes, with one intended entry per symbol per server day.
Risk controls include RiskPercent sizing and a MaxDailyRiskPct desk threshold, wh...
π Read | Forum | @mql5dev
β€11π6π₯2π2π€©1
A fixed 3-qubit quantum circuit is used as a nonlinear feature generator for MT5 price windows, modeling βuncertainty structureβ rather than claiming any quantum computing advantage. Mean return, volatility, and range drive RY rotations; a CNOT chain adds dependencies; 1000-shot simulation yields an 8-bin outcome histogram.
Seven metrics are extracted from that histogram: entropy, dominant-state probability, superposition width, outcome coherence, neighbor-bit correlation (entanglement proxy), variance, and count of significant states. Caching via window hashing is required to keep sliding-window runs practical.
These features are fused with classical OHLCV-derived inputs in a bidirectional LSTM pipeline (BatchNorm, ReLU, Dropout), trained with Focal Loss plus weighted sampling to handle directional imbalance. On a small EURUSD H1 sample, reported ga...
π Read | Quotes | @mql5dev
Seven metrics are extracted from that histogram: entropy, dominant-state probability, superposition width, outcome coherence, neighbor-bit correlation (entanglement proxy), variance, and count of significant states. Caching via window hashing is required to keep sliding-window runs practical.
These features are fused with classical OHLCV-derived inputs in a bidirectional LSTM pipeline (BatchNorm, ReLU, Dropout), trained with Focal Loss plus weighted sampling to handle directional imbalance. On a small EURUSD H1 sample, reported ga...
π Read | Quotes | @mql5dev
β€26π3β‘2π€©2π2π¨βπ»1
Position replay/simulation indicator update: C_IndicatorPosition is removed to eliminate an intermediate layer between the indicator and C_ElementsTrade. Methods and state move into the indicator so the new P/L label can access the opening-price component directly.
Profit/loss is computed as points to the best close price, not POSITION_PROFIT. Spread makes POSITION_PROFIT unreliable for exit viability, so closing logic uses Bid for long exits and Ask for short exits, sourced via SymbolInfoTick in OnCalculate.
C_ElementsTrade gains a label anchored to the opening line, updated with a formatted points delta using the symbolβs digits. The label color indicates positive vs negative, and ChartRedraw is used to avoid delayed UI refresh.
π Read | VPS | @mql5dev
Profit/loss is computed as points to the best close price, not POSITION_PROFIT. Spread makes POSITION_PROFIT unreliable for exit viability, so closing logic uses Bid for long exits and Ask for short exits, sourced via SymbolInfoTick in OnCalculate.
C_ElementsTrade gains a label anchored to the opening line, updated with a formatted points delta using the symbolβs digits. The label color indicates positive vs negative, and ChartRedraw is used to avoid delayed UI refresh.
π Read | VPS | @mql5dev
β€8π5β‘1π₯1π1