Strategy Tester does not cover live-chart conditions such as terminal restarts, EAs starting before account connect, multiple chart instances, server-side history changes, or chart button clicks. A demo-account bench is provided to validate these scenarios and emit a PASS/FAIL report.
LiveTestDriver.mq5 reads phase A/B/C from MQL5\Files\LiveTestBench\phase.txt, runs phase checks, then exits via TerminalClose(). Execution is blocked on non-demo accounts. ExampleDailyLock.mq5 is the EA under test, using global variables for persistence, enforcing one instance per account via GlobalVariableSetOnCondition, and exposing an Unlock button. ExampleDailyLock_DemoTest.mq5 builds a demo-only variant using DEMO_ONLY without modifying the EA source. run_live_test.ps1 writes startup config, launches a portable terminal per phase, and prints results.
Phase A validates start...
π Read | Freelance | @mql5dev
LiveTestDriver.mq5 reads phase A/B/C from MQL5\Files\LiveTestBench\phase.txt, runs phase checks, then exits via TerminalClose(). Execution is blocked on non-demo accounts. ExampleDailyLock.mq5 is the EA under test, using global variables for persistence, enforcing one instance per account via GlobalVariableSetOnCondition, and exposing an Unlock button. ExampleDailyLock_DemoTest.mq5 builds a demo-only variant using DEMO_ONLY without modifying the EA source. run_live_test.ps1 writes startup config, launches a portable terminal per phase, and prints results.
Phase A validates start...
π Read | Freelance | @mql5dev
β€12π10β‘2π₯2π€©2π¨βπ»1
TesterReport.mqh parses Strategy Tester reports saved as HTML (Backtest tab -> Report -> HTML) and exposes deals, reconstructed closed trades, and key summary figures for post-processing in MQL5. Typical uses include report comparison, portfolio aggregation, CSV export, and validation against account history.
Parsed settings include EA name, timeframe, currency, and initial deposit. Each Deals row is mapped to SReportDeal with time, ticket, symbol, type/direction, volume, price, commission, swap, profit, balance, and comment.
Closed trades (SReportTrade) are rebuilt because the HTML report has no position IDs. Each exit is matched against the oldest open entry on the same symbol with the opposite side. Partial closes and reversals generate multiple trades; entry commission is allocated pro-rata by closed volume. NetProfit() and balance drawdowns are com...
π Read | AppStore | @mql5dev
Parsed settings include EA name, timeframe, currency, and initial deposit. Each Deals row is mapped to SReportDeal with time, ticket, symbol, type/direction, volume, price, commission, swap, profit, balance, and comment.
Closed trades (SReportTrade) are rebuilt because the HTML report has no position IDs. Each exit is matched against the oldest open entry on the same symbol with the opposite side. Partial closes and reversals generate multiple trades; entry commission is allocated pro-rata by closed volume. NetProfit() and balance drawdowns are com...
π Read | AppStore | @mql5dev
π9β€7π₯2π€©2
A chart-side risk panel calculates position size before any order is sent, with explicit handling of broker volume rules.
For the active symbol it shows spread in points and the spread cost per 1.00 lot, plus point value per 1.00 lot derived from tick value and tick size for correct pricing on metals, indices, and non-USD crosses. It also prints the brokerβs min/step/max volume.
Risk can be set as % of balance, % of equity, or fixed account-currency amount. With a stop distance in points, it computes loss per 1.00 lot, the raw lot size, the lot rounded down to the volume step, and the actual money at risk after rounding.
Edge cases are made visible: when the raw lot is below broker minimum (risk cap cannot be respected), and when step rounding shifts real risk away from the requested value, with highlighting above a 10% gap. Read-only indicator: no ...
π Read | NeuroBook | @mql5dev
For the active symbol it shows spread in points and the spread cost per 1.00 lot, plus point value per 1.00 lot derived from tick value and tick size for correct pricing on metals, indices, and non-USD crosses. It also prints the brokerβs min/step/max volume.
Risk can be set as % of balance, % of equity, or fixed account-currency amount. With a stop distance in points, it computes loss per 1.00 lot, the raw lot size, the lot rounded down to the volume step, and the actual money at risk after rounding.
Edge cases are made visible: when the raw lot is below broker minimum (risk cap cannot be respected), and when step rounding shifts real risk away from the requested value, with highlighting above a 10% gap. Read-only indicator: no ...
π Read | NeuroBook | @mql5dev
β€6π5
PortfolioWeights.mqh adds portfolio-weight computation to MQL5 using matrix/vector types and no DLL. Inputs are return series per component, including symbols or daily PnL streams from multiple Expert Advisors.
Five long-only allocations are provided: InverseVolatility, RiskParity (cyclical coordinate descent), HierarchicalRiskParity using single-linkage on distance sqrt((1-corr)/2) with order[] output, MinimumVariance with optional per-component cap, and MaximumDiversification. Risk contributions per component are also reported.
Covariance estimation includes Ledoit-Wolf shrinkage, shrinking correlations toward zero based on optimal intensity on unit-variance scaled returns, improving stability when observations are limited relative to dimension. Minimum-variance and maximum-diversification are solved via active-set QP with bounds and one equality.
...
π Read | NeuroBook | @mql5dev
Five long-only allocations are provided: InverseVolatility, RiskParity (cyclical coordinate descent), HierarchicalRiskParity using single-linkage on distance sqrt((1-corr)/2) with order[] output, MinimumVariance with optional per-component cap, and MaximumDiversification. Risk contributions per component are also reported.
Covariance estimation includes Ledoit-Wolf shrinkage, shrinking correlations toward zero based on optimal intensity on unit-variance scaled returns, improving stability when observations are limited relative to dimension. Minimum-variance and maximum-diversification are solved via active-set QP with bounds and one equality.
...
π Read | NeuroBook | @mql5dev
β€7π5π€©1
ICT Model Tracker is a non-trading indicator that detects and measures a strict ICT setup sequence on any chart using closed bars only. It marks the liquidity sweep inside a killzone, the MSS with displacement and FVG (or iFVG), then the limit entry with SL/TP, and tracks each setup through expiry or outcome without repainting. Single file, no DLL.
A deliberately published negative baseline is included: US100.cash M5, Jan 2025 to Aug 2026, default settings averaged -0.05R per trade across 690 setups and 425 trades (profit factor 0.91), with no profitable configuration in the tested set. This is presented as model measurement rather than a coding issue, with independent replay matching events and stats.
Features include NY-time killzones with DST handling, multiple liquidity references, outcome labels (+R, -1R, EXP, MISS), and a stats panel segmented ...
π Read | Freelance | @mql5dev
A deliberately published negative baseline is included: US100.cash M5, Jan 2025 to Aug 2026, default settings averaged -0.05R per trade across 690 setups and 425 trades (profit factor 0.91), with no profitable configuration in the tested set. This is presented as model measurement rather than a coding issue, with independent replay matching events and stats.
Features include NY-time killzones with DST handling, multiple liquidity references, outcome labels (+R, -1R, EXP, MISS), and a stats panel segmented ...
π Read | Freelance | @mql5dev
π16β€7π₯2π¨βπ»2π1
DrawdownBootstrap.mqh estimates prospective drawdown depth over coming months using historical daily P/L series. Instead of treating the backtestβs single time order as representative, it applies Monte Carlo reordering to quantify expected drawdown percentiles and the frequency of exceeding the historical worst.
The implementation uses stationary bootstrap (Politis/Romano, 1994): each simulated path starts at a random day, advances sequentially, and jumps to a new random day with probability 1/meanBlock. Keeping multi-day blocks preserves losing streaks and clustered losses that are lost when sampling days independently. Each path records maximum peak-to-trough decline; Quantile() returns interpolated percentiles.
A deterministic mulberry32 RNG (CSeededRandom) ensures reproducible results across machines. Daily inputs can be money P/L (fixed lots) ...
π Read | Calendar | @mql5dev
The implementation uses stationary bootstrap (Politis/Romano, 1994): each simulated path starts at a random day, advances sequentially, and jumps to a new random day with probability 1/meanBlock. Keeping multi-day blocks preserves losing streaks and clustered losses that are lost when sampling days independently. Each path records maximum peak-to-trough decline; Quantile() returns interpolated percentiles.
A deterministic mulberry32 RNG (CSeededRandom) ensures reproducible results across machines. Daily inputs can be money P/L (fixed lots) ...
π Read | Calendar | @mql5dev
β€8π6π€©3π1
A filter is available for detecting whether the current bar is pushing into a local extreme, based on local high/low extrema with an ATR buffer.
Breach conditions are defined as: High breach when high[i] exceeds (local high extremum minus ATR times a multiplier). Low breach when low[i] falls below (local low extremum plus ATR times a multiplier). The ATR multiplier controls tolerance around the extremum.
Two operating modes are supported. Live bar mode evaluates the active, unclosed bar in real time. Closed-bar-only mode evaluates confirmed bars only, which is typically safer for automated execution that relies on settled OHLC values.
The intended use is as a gating layer for entry indicators that do not account for local extremes and may otherwise trigger buys into local highs or sells into local lows. Visual output flags risk zones: red markers in...
π Read | NeuroBook | @mql5dev
Breach conditions are defined as: High breach when high[i] exceeds (local high extremum minus ATR times a multiplier). Low breach when low[i] falls below (local low extremum plus ATR times a multiplier). The ATR multiplier controls tolerance around the extremum.
Two operating modes are supported. Live bar mode evaluates the active, unclosed bar in real time. Closed-bar-only mode evaluates confirmed bars only, which is typically safer for automated execution that relies on settled OHLC values.
The intended use is as a gating layer for entry indicators that do not account for local extremes and may otherwise trigger buys into local highs or sells into local lows. Visual output flags risk zones: red markers in...
π Read | NeuroBook | @mql5dev
β€13π9π€©3π₯1
BacktestOverfitting.mqh calculates the Probability of Backtest Overfitting (PBO) for an MT5 optimization. PBO measures how often the pass that ranks best in one half of the history ends up in the lower half across all passes on the other half. High PBO indicates parameter selection driven mainly by noise rather than repeatable edge.
The implementation follows combinatorially symmetric cross-validation (Bailey, Borwein, Lopez de Prado, Zhu, 2017). Daily results are emitted per pass from OnTester() as frames, then consolidated into a matrix in OnTesterDeinit() after the final pass.
History is partitioned into S equal day blocks; all S/2 vs S/2 in-sample/out-of-sample combinations are evaluated (for S=16: C(16,8)=12,870 splits). Selection uses in-sample Sharpe (or mean with PBO_MEAN), then ranks the chosen pass out of sample to form logits. Output includes PBO, los...
π Read | Freelance | @mql5dev
The implementation follows combinatorially symmetric cross-validation (Bailey, Borwein, Lopez de Prado, Zhu, 2017). Daily results are emitted per pass from OnTester() as frames, then consolidated into a matrix in OnTesterDeinit() after the final pass.
History is partitioned into S equal day blocks; all S/2 vs S/2 in-sample/out-of-sample combinations are evaluated (for S=16: C(16,8)=12,870 splits). Selection uses in-sample Sharpe (or mean with PBO_MEAN), then ranks the chosen pass out of sample to form logits. Output includes PBO, los...
π Read | Freelance | @mql5dev
β€11π5π₯3π2
Most βEA does not workβ reports come from the trading environment, not the code: terminal AutoTrading disabled, netting vs hedging mismatch, unsupported filling mode, stops inside StopsLevel/FreezeLevel, or volume not matching step and limits.
TradeEnvCheck is a read-only script that generates a single report before installing or commissioning an EA. Run it once on a chart for the target symbol. Output goes to the Experts log, a short on-chart summary, and a text file at MQL5\Files\TradeEnvCheck_<symbol>.txt. No trading actions are performed.
The report captures account details, margin mode with hedging/netting implications, required trading permissions, and margin call/stop out levels. Per symbol it lists trade/execution/profit modes, price/contract parameters, supported filling modes (and the one to use), allowed order/expiration types, stops and freeze lev...
π Read | Forum | @mql5dev
TradeEnvCheck is a read-only script that generates a single report before installing or commissioning an EA. Run it once on a chart for the target symbol. Output goes to the Experts log, a short on-chart summary, and a text file at MQL5\Files\TradeEnvCheck_<symbol>.txt. No trading actions are performed.
The report captures account details, margin mode with hedging/netting implications, required trading permissions, and margin call/stop out levels. Per symbol it lists trade/execution/profit modes, price/contract parameters, supported filling modes (and the one to use), allowed order/expiration types, stops and freeze lev...
π Read | Forum | @mql5dev
β€12π11π₯2π€©2
Single-layer neurons can learn linearly separable logic (AND/OR/NAND/NOR) but fail on XOR/XNOR, a concrete example of why βone neuron learns everythingβ is false.
The workaround borrows from digital electronics: build XOR as a small circuit composed of gates the neuron can already model. A NOR and an AND feed a second NOR, matching the XOR truth table.
In MQL5, this is implemented by storing separate weights and biases per internal gate, training only NOR and AND via finite-difference gradient updates. XOR output is then computed by composing these learned gates, effectively embedding a tiny network inside one neuronβuseful for designing non-linear decision logic in trading code without expanding model complexity.
π Read | CodeBase | @mql5dev
The workaround borrows from digital electronics: build XOR as a small circuit composed of gates the neuron can already model. A NOR and an AND feed a second NOR, matching the XOR truth table.
In MQL5, this is implemented by storing separate weights and biases per internal gate, training only NOR and AND via finite-difference gradient updates. XOR output is then computed by composing these learned gates, effectively embedding a tiny network inside one neuronβuseful for designing non-linear decision logic in trading code without expanding model complexity.
π Read | CodeBase | @mql5dev
π8π€©6β€5
GapTracker scans any symbol and timeframe for opening gaps where the bar open is a configurable number of points away from the prior close. Gaps are categorized as daily (first bar of a new server day), weekend/holiday (first bar after a pause beyond a threshold, 36h default), and optionally intraday bar-to-bar.
Each gap is tracked until filled, defined as price trading back to the previous close. The gap bar counts, so same-bar closures report as 0 bars to fill, with an optional cutoff after N bars.
On-chart output uses rectangles from previous close to open, extended to the fill bar or the latest bar if still open, with size labels and configurable colors; filled gaps turn grey. Drawing is capped (200 recent gaps by default) to limit clutter, with hover tooltips for full details.
Realtime alerts support pop-up, push, and sound, while CSV logging r...
π Read | CodeBase | @mql5dev
Each gap is tracked until filled, defined as price trading back to the previous close. The gap bar counts, so same-bar closures report as 0 bars to fill, with an optional cutoff after N bars.
On-chart output uses rectangles from previous close to open, extended to the fill bar or the latest bar if still open, with size labels and configurable colors; filled gaps turn grey. Drawing is capped (200 recent gaps by default) to limit clutter, with hover tooltips for full details.
Realtime alerts support pop-up, push, and sound, while CSV logging r...
π Read | CodeBase | @mql5dev
π8β€7π€©6π₯5β2
This follow-up completes a doubly linked list in MQL5 built around operator overloading, moving from βpush/readβ basics to a safer, more usable container.
A class destructor is added to guarantee allocated nodes are released, eliminating MT5 resource warnings and enabling predictable lifetime management when lists go out of scope.
The list gains non-destructive element access: values can be read or modified by index without consuming nodes, with optional syntax that keeps call sites compact via overloaded operators.
For deletion, the implementation is refactored so a manager class owns list structure while node objects handle linkage, simplifying pointer updates. Edge-node removal initially crashes due to missing head/tail fixes, then is corrected with explicit boundary handling.
Finally, the article explores an advanced pattern: overloading subscript ...
π Read | AlgoBook | @mql5dev
A class destructor is added to guarantee allocated nodes are released, eliminating MT5 resource warnings and enabling predictable lifetime management when lists go out of scope.
The list gains non-destructive element access: values can be read or modified by index without consuming nodes, with optional syntax that keeps call sites compact via overloaded operators.
For deletion, the implementation is refactored so a manager class owns list structure while node objects handle linkage, simplifying pointer updates. Edge-node removal initially crashes due to missing head/tail fixes, then is corrected with explicit boundary handling.
Finally, the article explores an advanced pattern: overloading subscript ...
π Read | AlgoBook | @mql5dev
π₯9π7β€3π€©3
Order Watchdog is a read-only MT5 Expert Advisor for account-wide monitoring. It never opens, closes, or modifies trades on live or demo charts. It only reads positions, orders, and deal history, then sends alerts when account state deviates from expected rules, including after reconnects, restarts, or broker-side issues.
Alert conditions include unknown magic numbers (with optional manual-trade allowance), duplicate positions per magic/symbol/direction, missing stop loss after a grace period, broker stop-outs, and stop-loss fills beyond a configured slippage limit. On startup it also reviews history to report unknown-magic opens and stop-outs that occurred while it was offline.
Configuration is based on a magic list supporting ranges, optional max-per-magic limits, and optional SL requirements. Alerts are throttled to one per issue until resolved, merged per sc...
π Read | Docs | @mql5dev
Alert conditions include unknown magic numbers (with optional manual-trade allowance), duplicate positions per magic/symbol/direction, missing stop loss after a grace period, broker stop-outs, and stop-loss fills beyond a configured slippage limit. On startup it also reviews history to report unknown-magic opens and stop-outs that occurred while it was offline.
Configuration is based on a magic list supporting ranges, optional max-per-magic limits, and optional SL requirements. Alerts are throttled to one per issue until resolved, merged per sc...
π Read | Docs | @mql5dev
β€12π10π₯6π€©6β2
Color Harmony Algorithm (CHA), Zaeimi/Goddosian 2020, maps a metaheuristic population onto a 100-sector hue circle split into 10 groups, each with a leader βagentβ in sector centers (5, 15, β¦, 95). Parent selection is constrained by five geometric harmony templates, enforcing cross-group structure and preserving diversity without relying on incidental clustering.
Execution alternates between concentration and dispersion using measured diversity Dpop versus a threshold Dth, damped after dispersion. Concentration generates linear mixtures with r1 in [0.1, 0.9] plus a decaying Gaussian perturbation (10% to 1% of range); without perturbation, candidates stay inside the initial convex hull and fail on harder landscapes.
Dispersion replaces near-center non-agents using a color-memory buffer of rejected candidates: Xnew = rcmΒ·XCM + (1-rcm)Β·Xold. An MQL5/C_A...
π Read | AlgoBook | @mql5dev
Execution alternates between concentration and dispersion using measured diversity Dpop versus a threshold Dth, damped after dispersion. Concentration generates linear mixtures with r1 in [0.1, 0.9] plus a decaying Gaussian perturbation (10% to 1% of range); without perturbation, candidates stay inside the initial convex hull and fail on harder landscapes.
Dispersion replaces near-center non-agents using a color-memory buffer of rejected candidates: Xnew = rcmΒ·XCM + (1-rcm)Β·Xold. An MQL5/C_A...
π Read | AlgoBook | @mql5dev
π11π₯9β€6π€©5
Temporal Motion Aggregation (TMA) reframes market data as an event stream with irregular intensity, instead of fixed bars. The pipeline segments events into overlapping windows, aligns segments to a common scale, then aggregates recurring micro-structures to suppress noise and preserve trend logic.
Current work moves from theory to implementation in MQL5 with OpenCL. Focus is the Motion Feature Encoder (MFE): two channels (raw events and cross-layer correlations) processed in true parallelism using a multi-window convolution layer, followed by SoftPlus and batch normalization per channel.
A new CNeuronTMAMFE class extends CNeuronConvOCL, builds an internal encoder chain (multi-window conv, activation, BN, second conv stage), then hands off to the parent convolution for final feature fusion. The forward pass is a strict layer-by-layer transfer with ea...
π Read | AlgoBook | @mql5dev
Current work moves from theory to implementation in MQL5 with OpenCL. Focus is the Motion Feature Encoder (MFE): two channels (raw events and cross-layer correlations) processed in true parallelism using a multi-window convolution layer, followed by SoftPlus and batch normalization per channel.
A new CNeuronTMAMFE class extends CNeuronConvOCL, builds an internal encoder chain (multi-window conv, activation, BN, second conv stage), then hands off to the parent convolution for final feature fusion. The forward pass is a strict layer-by-layer transfer with ea...
π Read | AlgoBook | @mql5dev
π₯13β€7π5π€©5
Volume remains a core market activity input, but it behaves differently across venues. Centralized exchanges provide real trade volume, while spot FX typically exposes tick volume as a proxy. Signal quality depends on broker feed, instrument, and regime, which becomes critical in automated systems.
A proposed pipeline targets volume change rather than level: Ln(volume+1) to compress spikes, then bar-to-bar delta, followed by arctan(x) to bound output within Β±Ο/2. This yields scale-independent values that remain comparable across symbols and timeframes.
Execution logic uses a user threshold and three entry gates: positive-only, negative-only, or both. Order direction is confirmed by candle close versus open, not by signal sign. Exits support fixed SL/TP, an N-candle time/price rule, or a combined mode, with one position allowed at a time.
π Read | Quotes | @mql5dev
A proposed pipeline targets volume change rather than level: Ln(volume+1) to compress spikes, then bar-to-bar delta, followed by arctan(x) to bound output within Β±Ο/2. This yields scale-independent values that remain comparable across symbols and timeframes.
Execution logic uses a user threshold and three entry gates: positive-only, negative-only, or both. Order direction is confirmed by candle close versus open, not by signal sign. Exits support fixed SL/TP, an N-candle time/price rule, or a combined mode, with one position allowed at a time.
π Read | Quotes | @mql5dev
π₯9π6β€4π€©4π€2β‘1
Markets generate asynchronous event streams: quotes, trades, order updates. During volatility, event density rises and time no longer behaves like a uniform index. Point-based time series and bar aggregation lose microstructure ordering and smear causality.
TMA (Temporal Motion Aggregation), built for event-camera optical flow, maps well to market data as event processing. Key blocks are event splitting into short overlapping segments, linear temporal alignment to synchronize displaced activity, and motion-pattern aggregation to suppress noise and keep coherent movement.
Applied to finance, this becomes a way to build a temporally dense correlation field across micro-slices, aligned onto a common timeline, then aggregated into a stable estimate of direction and rate of change for capital flow.
π Read | Calendar | @mql5dev
TMA (Temporal Motion Aggregation), built for event-camera optical flow, maps well to market data as event processing. Key blocks are event splitting into short overlapping segments, linear temporal alignment to synchronize displaced activity, and motion-pattern aggregation to suppress noise and keep coherent movement.
Applied to finance, this becomes a way to build a temporally dense correlation field across micro-slices, aligned onto a common timeline, then aggregated into a stable estimate of direction and rate of change for capital flow.
π Read | Calendar | @mql5dev
π₯6β€5π5π€©3π2
CPPI in MetaTrader 5 is a position sizing rule, not a buy/sell signal. It maps current equity to a floor, a cushion, and a multiplier-based target exposure, then scales a long position up or down without forecasts or indicators.
MT5 changes two assumptions. The βsafeβ leg is just being flat, with no bond yield compounding the floor. Rebalancing is discrete per tick and typically gated by a rebalance band to reduce spread cost.
Implementation is split into stateless math (four formulas), a trading engine that handles lot rounding, netting vs hedging reduction, and cash-lock behavior, plus an indicator that runs a price-only simulation and cannot reproduce real equity history.
Key risks remain: gap breaches versus 1/m, cash-lock persistence, and minimum lot constraints on small accounts.
π Read | CodeBase | @mql5dev
MT5 changes two assumptions. The βsafeβ leg is just being flat, with no bond yield compounding the floor. Rebalancing is discrete per tick and typically gated by a rebalance band to reduce spread cost.
Implementation is split into stateless math (four formulas), a trading engine that handles lot rounding, netting vs hedging reduction, and cash-lock behavior, plus an indicator that runs a price-only simulation and cannot reproduce real equity history.
Key risks remain: gap breaches versus 1/m, cash-lock persistence, and minimum lot constraints on small accounts.
π Read | CodeBase | @mql5dev
β€6π₯6π5π3π€©2
Manual PDF edits do not scale. Any byte shift breaks /Length, xref offsets, and startxref. Viewers may repair, render blank, or refuse the file, since the format does not validate those numbers.
The core rule is simple: file-describing numbers must be derived from the bytes already written, never maintained as literals. Current position equals buffer Length(); stream size equals content buffer Length().
CPdfBuffer owns a growable uchar array with doubling capacity, cheap reuse via Clear(), ASCII token output, PDF-safe number formatting, and fixed-width xref entry padding. Save writes only used length to avoid trailing zeros.
CPdfWriter allocates object numbers, records each object offset from buffer Length() at BeginObject(), supports forward references, and emits xref from observed offsets. Finish fails if allocated objects were never written or if nesting is ...
π Read | Calendar | @mql5dev
The core rule is simple: file-describing numbers must be derived from the bytes already written, never maintained as literals. Current position equals buffer Length(); stream size equals content buffer Length().
CPdfBuffer owns a growable uchar array with doubling capacity, cheap reuse via Clear(), ASCII token output, PDF-safe number formatting, and fixed-width xref entry padding. Save writes only used length to avoid trailing zeros.
CPdfWriter allocates object numbers, records each object offset from buffer Length() at BeginObject(), supports forward references, and emits xref from observed offsets. Finish fails if allocated objects were never written or if nesting is ...
π Read | Calendar | @mql5dev
π€©6π4β€3
Candlesticks show price movement, but not where volume accumulated. A volume-at-price profile solves that by producing reproducible levels: point of control, value area bounds, and volume split above/below current price.
An MQL5 indicator can approximate volume distribution per bar using tick or real volume, with two allocation policies: spread volume across the bar range or concentrate it at the close with a neighbor split. A rolling window is binned into horizontal price levels, then POC and value area are computed and published to six buffers for EAs and alerts.
Visualization includes a heatmap behind candles plus a live side profile with tagged levels. Performance is handled via ring-buffer column storage, cached base-layer rendering, alpha blending, and selective redraw on viewport changes.
π Read | CodeBase | @mql5dev
An MQL5 indicator can approximate volume distribution per bar using tick or real volume, with two allocation policies: spread volume across the bar range or concentrate it at the close with a neighbor split. A rolling window is binned into horizontal price levels, then POC and value area are computed and published to six buffers for EAs and alerts.
Visualization includes a heatmap behind candles plus a live side profile with tagged levels. Performance is handled via ring-buffer column storage, cached base-layer rendering, alpha blending, and selective redraw on viewport changes.
π Read | CodeBase | @mql5dev
π8β€5π₯2π€―1
This part upgrades an MT5 news filter from βall High events are equalβ to a tiered, rule-driven system that handles releases with longer market impact, like rate decisions plus statements and press conferences.
Events are classified once through a shared function used by both the live economic calendar and the Strategy Tester CSV, removing duplicated logic and keeping backtests aligned with live trading.
A new ordered tier scale preserves the calendarβs levels and adds a Special tier above High. Each event now carries its own before/after window, so Special events can pause trading longer without widening every High release.
Special handling is defined as data: a rule table (optionally overridden via CSV) matches events by currency plus name/code (substring or exact), can promote/demote tiers, and can override windows. A companion script prints the brokerβ...
π Read | Signals | @mql5dev
Events are classified once through a shared function used by both the live economic calendar and the Strategy Tester CSV, removing duplicated logic and keeping backtests aligned with live trading.
A new ordered tier scale preserves the calendarβs levels and adds a Special tier above High. Each event now carries its own before/after window, so Special events can pause trading longer without widening every High release.
Special handling is defined as data: a rule table (optionally overridden via CSV) matches events by currency plus name/code (substring or exact), can promote/demote tiers, and can override windows. A companion script prints the brokerβ...
π Read | Signals | @mql5dev
π8β€4π€©2