Currency Exposure and Leverage Monitor aggregates every open position into currency legs and reports net exposure per currency in account currency. It highlights when several trades that look unrelated are effectively the same directional risk, such as multiple USD shorts created via EURUSD, GBPUSD, and XAUUSD.
The panel ranks currencies by gross contribution and visualizes long vs short exposure around a zero axis. It also calculates effective leverage as gross notional divided by equity, compared with broker leverage, with configurable warning thresholds and concentration flags when a single currency exceeds a set share of total exposure.
For the three largest exposures, a sensitivity section estimates equity impact for a configurable currency move (default 1%), in money and as a percentage of equity. Opposing legs are netted to expose hidden offse...
π Read | Quotes | @mql5dev
The panel ranks currencies by gross contribution and visualizes long vs short exposure around a zero axis. It also calculates effective leverage as gross notional divided by equity, compared with broker leverage, with configurable warning thresholds and concentration flags when a single currency exceeds a set share of total exposure.
For the three largest exposures, a sensitivity section estimates equity impact for a configurable currency move (default 1%), in money and as a percentage of equity. Opposing legs are netted to expose hidden offse...
π Read | Quotes | @mql5dev
β€19π8π₯8π€©8
RSI extremes label momentum, not direction. A 70+ reading can align with bullish continuation; a 30- reading can persist during bearish continuation. Directional intent requires market structure.
A closed-bar analytical EA can separate βthreshold crossing detectedβ from βtrade bias validated.β It detects RSI crossings on completed candles, reconstructs the last two confirmed swing highs and lows, and classifies structure as bullish, bearish, or range.
Signals are validated only when structure and a break of structure (BOS) agree. BOS is confirmed by a completed close beyond the latest swing level, with a configurable buffer and a prior close that was not already beyond.
Mixed structure arms a time-limited candidate. Opposite BOS within the confirmation window validates reversal; otherwise the candidate expires. Output stays diagnostic: comments, uni...
π Read | Forum | @mql5dev
A closed-bar analytical EA can separate βthreshold crossing detectedβ from βtrade bias validated.β It detects RSI crossings on completed candles, reconstructs the last two confirmed swing highs and lows, and classifies structure as bullish, bearish, or range.
Signals are validated only when structure and a break of structure (BOS) agree. BOS is confirmed by a completed close beyond the latest swing level, with a configurable buffer and a prior close that was not already beyond.
Mixed structure arms a time-limited candidate. Opposite BOS within the confirmation window validates reversal; otherwise the candidate expires. Output stays diagnostic: comments, uni...
π Read | Forum | @mql5dev
β€25π12π€©8π₯5π4
MT5 alerts can only beep or play fixed WAV files, so key events stay trapped on-screen. The article builds a single MQL5 include that enables runtime text-to-speech from EAs and scripts via a Speak() function, while deliberately blocking indicators and refusing unsafe contexts like Strategy Tester.
Instead of a COM wrapper DLL, MQL5 launches a hidden PowerShell process through WinAPI CreateProcessW. PowerShell uses Windows SAPI to select an installed voice, set rate (-10..10) and volume (0..100), and speak synchronously.
Safety and robustness come from UTF-16 Base64 (-EncodedCommand) to prevent command-line injection, XML-aware handling (plain vs tagged text), strict length limits, timeouts with forced termination, and exit codes to report missing voices, malformed markup, or execution errors.
π Read | AppStore | @mql5dev
Instead of a COM wrapper DLL, MQL5 launches a hidden PowerShell process through WinAPI CreateProcessW. PowerShell uses Windows SAPI to select an installed voice, set rate (-10..10) and volume (0..100), and speak synchronously.
Safety and robustness come from UTF-16 Base64 (-EncodedCommand) to prevent command-line injection, XML-aware handling (plain vs tagged text), strict length limits, timeouts with forced termination, and exit codes to report missing voices, malformed markup, or execution errors.
π Read | AppStore | @mql5dev
β€13π9π€©8π₯7
EV-MGRFlowNet is being ported to MQL5 with OpenCL to handle market microstructure as an event stream rather than fixed time windows. Core blocks remain FERE-Net (ConvGRU/ST-ConvGRU) for long temporal context, FGD-Net for multi-scale reconstruction of a motion vector, and HMC-Loss for self-supervised training without labels.
Current work shifts from event encoding to reconstruction via the FGD-Net decoder. Decoder inputs are built from concatenated signals: prior decoder output plus the matching encoder level, enabling continuous correction against the original event structure.
A CNeuronFGDModule is implemented as a standalone decoder unit: batch norm, cD conv with TANH, flow projection, strict concatenation, and cXH multi-window conv producing GRU gates in one OpenCL pass. Forward pass follows deterministic sequencing, explicit state handling, and gradient...
π Read | AlgoBook | @mql5dev
Current work shifts from event encoding to reconstruction via the FGD-Net decoder. Decoder inputs are built from concatenated signals: prior decoder output plus the matching encoder level, enabling continuous correction against the original event structure.
A CNeuronFGDModule is implemented as a standalone decoder unit: batch norm, cD conv with TANH, flow projection, strict concatenation, and cXH multi-window conv producing GRU gates in one OpenCL pass. Forward pass follows deterministic sequencing, explicit state handling, and gradient...
π Read | AlgoBook | @mql5dev
β€18π9π€©7π₯4π2β‘1
LearnedStrategy exposes signal generation and metadata, but no interface for post-trade outcomes. After deployment, evidence arrives one trade at a time, and retirement rules become sequential tests with repeated looks.
A fixed 0.95 Beta-posterior trigger is statistically valid per look, but not per stream. Simulated at a 48.5% win rate, checking after every trade retired healthy runs 33.4% of the time over 300 trades; a single look at trade 300 was 5.2%. Raising the trigger to 0.9956 restored ~5% false alarms but reduced sensitivity.
WinRateSPRT adds two modes: Wald terminating SPRT for fixed batches, and Page reflecting CUSUM for continuous monitoring. CUSUM requires a planned horizon; calibrating the boundary to 5% false alarms over 300 trades raised detection delay (ARL1 ~99 to ~173 trades) but materially improved break detection versus posteri...
π Read | Forum | @mql5dev
A fixed 0.95 Beta-posterior trigger is statistically valid per look, but not per stream. Simulated at a 48.5% win rate, checking after every trade retired healthy runs 33.4% of the time over 300 trades; a single look at trade 300 was 5.2%. Raising the trigger to 0.9956 restored ~5% false alarms but reduced sensitivity.
WinRateSPRT adds two modes: Wald terminating SPRT for fixed batches, and Page reflecting CUSUM for continuous monitoring. CUSUM requires a planned horizon; calibrating the boundary to 5% false alarms over 300 trades raised detection delay (ARL1 ~99 to ~173 trades) but materially improved break detection versus posteri...
π Read | Forum | @mql5dev
β€15π7π₯7π€©5
This MQL5 article builds a trend stop that adapts to market regime instead of trailing at a fixed distance. On each flip, the stop is reseeded a configurable number of slow-ATR multiples beyond the flip barβs high/low, then accelerates toward price bar-by-bar with a capped speed so early noise is tolerated and stalled trends are exited sooner.
Acceleration is boosted by how far price is from a reference VWAP (session/week/month, or combinations). That same VWAP relationship grades flips as confirmed or filtered, publishes the stop/trend/grade via buffers, and optionally alerts only on live bars.
Visualization is treated as a first-class feature: persistent flip levels remain until invalidated by a close, while a blended canvas draws an anti-aliased stop line, a non-obscuring cloud, and precise labels without performance-heavy floating point work.
π Read | Docs | @mql5dev
Acceleration is boosted by how far price is from a reference VWAP (session/week/month, or combinations). That same VWAP relationship grades flips as confirmed or filtered, publishes the stop/trend/grade via buffers, and optionally alerts only on live bars.
Visualization is treated as a first-class feature: persistent flip levels remain until invalidated by a close, while a blended canvas draws an anti-aliased stop line, a non-obscuring cloud, and precise labels without performance-heavy floating point work.
π Read | Docs | @mql5dev
β€13π11π€©9π₯2
This article tackles two common failure modes in ML trading: noisy price-derived features that overfit, and equity curves dominated by a single instrumentβs regime.
It builds a Python+MT5 pipeline around a causal L1 Trend Filter solved with ADMM (banded O(N) iterations, adaptive rho, correct residual tracking). A sliding window makes the filter usable live, producing a piecewise-linear trend and explicit breakpoints.
Features come from trend geometry and indicators computed on the filtered series, with targets defined over a structural horizon (3 L1 segments) rather than fixed time. Models are trained per symbol with CatBoost and strict walk-forward (purge/embargo, internal early stopping).
Portfolio stability is improved by trading 29 instruments and sizing lots via 95% parametric VaR, allocating inversely to volatility and backtesting the weight...
π Read | VPS | @mql5dev
It builds a Python+MT5 pipeline around a causal L1 Trend Filter solved with ADMM (banded O(N) iterations, adaptive rho, correct residual tracking). A sliding window makes the filter usable live, producing a piecewise-linear trend and explicit breakpoints.
Features come from trend geometry and indicators computed on the filtered series, with targets defined over a structural horizon (3 L1 segments) rather than fixed time. Models are trained per symbol with CatBoost and strict walk-forward (purge/embargo, internal early stopping).
Portfolio stability is improved by trading 29 instruments and sizing lots via 95% parametric VaR, allocating inversely to volatility and backtesting the weight...
π Read | VPS | @mql5dev
β€10π8π₯6π€©3
Volatility tools built on close-to-close returns discard intrabar dispersion. OHLC-based estimators reduce that loss and react faster to regime shifts, with direct impact on sizing, stops, and breakout timing.
The GarmanβKlass (1980) variance estimator uses ln(H/L)^2 plus a corrected ln(C/O)^2 term. It is theoretically more efficient than close-to-close under zero drift, but it ignores prior-close to current-open gaps, which can understate risk in instruments with frequent jumps.
Testing on synthetic GBM in Python showed materially lower MSE for GK, but also exposed a failure mode: GK-to-MA crossovers do not classify regimes. Percentile rank over a lookback window produced stable squeeze (<30th) to expansion (>60th) signals, filtered by a directional SMA.
In MQL5, correct series indexing, incremental recalculation, and storing recursive squeeze s...
π Read | Signals | @mql5dev
The GarmanβKlass (1980) variance estimator uses ln(H/L)^2 plus a corrected ln(C/O)^2 term. It is theoretically more efficient than close-to-close under zero drift, but it ignores prior-close to current-open gaps, which can understate risk in instruments with frequent jumps.
Testing on synthetic GBM in Python showed materially lower MSE for GK, but also exposed a failure mode: GK-to-MA crossovers do not classify regimes. Percentile rank over a lookback window produced stable squeeze (<30th) to expansion (>60th) signals, filtered by a directional SMA.
In MQL5, correct series indexing, incremental recalculation, and storing recursive squeeze s...
π Read | Signals | @mql5dev
β€13π€©6π₯5π3
This article builds an MT5 βsignal routerβ that mimics discretionary filtering: a lightweight online classifier scores direction, Shannon entropy converts the score into uncertainty, then signals are auto-traded, skipped, or sent to a human review step. In Strategy Tester, the human step is replaced with deterministic proxies (always confirm/reject) or seeded randomness.
Key engineering choices: rolling online logistic regression with warm-start refits on a 300-bar window, careful no-leak label indexing, and a PΒ² streaming quantile to keep a fixed review budget under distribution drift without storing all history. Execution code enforces broker constraints (stops/freeze, min lot, fill modes) and attributes PnL per decision tag.
Validation is treated as the core problem: thresholds are tuned on one window and judged on a held-out window against mult...
π Read | AppStore | @mql5dev
Key engineering choices: rolling online logistic regression with warm-start refits on a 300-bar window, careful no-leak label indexing, and a PΒ² streaming quantile to keep a fixed review budget under distribution drift without storing all history. Execution code enforces broker constraints (stops/freeze, min lot, fill modes) and attributes PnL per decision tag.
Validation is treated as the core problem: thresholds are tuned on one window and judged on a held-out window against mult...
π Read | AppStore | @mql5dev
π€©6π4π₯4β€2
State-space models formalize sequential data via latent states and an observation process. A categorical HMM is the discrete-state, categorical-emission case, with dynamics defined by a transition matrix and conditional independence of observations given the current state.
An MQL5 CCategoricalHMM implementation targets regime inference from event sequences such as candlestick colors. Core methods include forward-backward posterior inference, Baum-Welch EM training, Monte Carlo sampling, online Bayesian filtering, and model selection via AIC/BIC.
Training stability is handled with Bayesian pseudocount regularization for transition/emission matrices and Dirichlet-based random initialization to avoid zero-probability degeneracy. A two-die experiment (fair vs loaded) demonstrates state decoding, filtering vs smoothing behavior, and likelihood-driven parameter learning.
π Read | Signals | @mql5dev
An MQL5 CCategoricalHMM implementation targets regime inference from event sequences such as candlestick colors. Core methods include forward-backward posterior inference, Baum-Welch EM training, Monte Carlo sampling, online Bayesian filtering, and model selection via AIC/BIC.
Training stability is handled with Bayesian pseudocount regularization for transition/emission matrices and Dirichlet-based random initialization to avoid zero-probability degeneracy. A two-die experiment (fair vs loaded) demonstrates state decoding, filtering vs smoothing behavior, and likelihood-driven parameter learning.
π Read | Signals | @mql5dev
β€9π₯5π4π¨βπ»2π€©1
Daily P/L by Magic Number renders account history and current open positions as a compact on-chart table, grouped by strategy magic number or an assigned name. Rows cover Today, Week, and Month results, with optional inclusion of floating P/L. Additional columns show current float, trades closed today, and DayDD (largest intraday drop from the dayβs peak while running). A TOTAL row aggregates all values, with green/red/grey color coding.
Designed for multi-EA accounts where a single balance curve hides attribution. It separates manual trading (magic 0), highlights abnormal losses or elevated DayDD early, and supports hedging or netting on any symbol/timeframe from a single chart.
Periods follow broker server time; weeks start Monday and months on the 1st. History is read from the earliest of the current week or month to limit load. Intraday drawdown combin...
π Read | NeuroBook | @mql5dev
Designed for multi-EA accounts where a single balance curve hides attribution. It separates manual trading (magic 0), highlights abnormal losses or elevated DayDD early, and supports hedging or netting on any symbol/timeframe from a single chart.
Periods follow broker server time; weeks start Monday and months on the 1st. History is read from the earliest of the current week or month to limit load. Intraday drawdown combin...
π Read | NeuroBook | @mql5dev
π7β€5π€©5π₯4
Parameter searches can manufacture a positive Sharpe by selecting the best of many trials. The article quantifies this selection effect by rerunning the entire MT5-style development pipeline on bar-permuted EURUSD H1 data that preserves per-bar OHLC structure and drift but removes inter-bar predictability.
A 100-pair moving-average crossover search shows Sharpe 0.17 on real 2018β2024 data, yet the same search on permuted bars produces a higher median Sharpe (~0.25). Across multiple parameter sets, the real outcome sits near the middle of the null distribution with non-informative p-values, indicating no measurable edge beyond what noise plus selection produces.
Key tooling includes full process permutation, spurious performance curves versus trial budget, distribution-free quantile confidence intervals, and cache-isolation checks to prevent stale artifa...
π Read | VPS | @mql5dev
A 100-pair moving-average crossover search shows Sharpe 0.17 on real 2018β2024 data, yet the same search on permuted bars produces a higher median Sharpe (~0.25). Across multiple parameter sets, the real outcome sits near the middle of the null distribution with non-informative p-values, indicating no measurable edge beyond what noise plus selection produces.
Key tooling includes full process permutation, spurious performance curves versus trial budget, distribution-free quantile confidence intervals, and cache-isolation checks to prevent stale artifa...
π Read | VPS | @mql5dev
π10β€7π₯6π€©3π¨βπ»1π1
Part 5 packages the adaptive Parabolic SAR trailing stop as AdaptivePSARTrail.mqh, built for inclusion in existing MQL5 Expert Advisors. The module can trail positions it did not open, qualifying by symbol and magic number, while keeping its own SAR series and DivergenceEngine state.
Naive βset SL to last SARβ fails at SAR side flips and under broker constraints. The utility blocks wrong-side stops, enforces non-regression, and sequences checks for stop distance, freeze level, and tick grid to avoid silent stagnation and journal spam.
Integration is a four-call lifecycle: Init(cfg), Refresh() on new bars, ApplyToPositions() on ticks, and Deinit(). Trading calls are compile-guarded to allow indicator builds without CTrade. Acceleration adapts per bar using opposing divergence within a bar-age limit, with optional reset on trend change.
A demo EA runs...
π Read | Quotes | @mql5dev
Naive βset SL to last SARβ fails at SAR side flips and under broker constraints. The utility blocks wrong-side stops, enforces non-regression, and sequences checks for stop distance, freeze level, and tick grid to avoid silent stagnation and journal spam.
Integration is a four-call lifecycle: Init(cfg), Refresh() on new bars, ApplyToPositions() on ticks, and Deinit(). Trading calls are compile-guarded to allow indicator builds without CTrade. Acceleration adapts per bar using opposing divergence within a bar-age limit, with optional reset on trend change.
A demo EA runs...
π Read | Quotes | @mql5dev
β€5π5π4π₯2π€©2
Automated trading often stops without visible errors due to PC sleep, terminal disconnects, algo trading being disabled, profile changes, or an EA being removed from a chart. BotWatchdog is designed to detect these conditions and send push notifications to a phone. It does not place trades.
Alerts include broker connection lost or restored, algo trading switched off or on, watched EAs missing from all charts with a comma-separated name list, terminal login changed to an unexpected account, open positions without a stop-loss for N minutes, equity falling by a configured percentage from the dayβs starting balance, and margin level dropping below a defined threshold.
A daily scheduled βall OKβ heartbeat can be configured; if it does not arrive, the terminal or host PC is likely offline. A final alert is triggered if the watchdog is removed.
Setup requires en...
π Read | CodeBase | @mql5dev
Alerts include broker connection lost or restored, algo trading switched off or on, watched EAs missing from all charts with a comma-separated name list, terminal login changed to an unexpected account, open positions without a stop-loss for N minutes, equity falling by a configured percentage from the dayβs starting balance, and margin level dropping below a defined threshold.
A daily scheduled βall OKβ heartbeat can be configured; if it does not arrive, the terminal or host PC is likely offline. A final alert is triggered if the watchdog is removed.
Setup requires en...
π Read | CodeBase | @mql5dev
β€6π€©1