MQL5 Algo Trading
579K subscribers
4.62K photos
7 videos
4.63K links
The best publications of the largest community of algotraders.

Subscribe to stay up-to-date with modern technologies and trading programs development.
Download Telegram
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
🀩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
❀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
πŸ‘7❀5🀩4πŸ”₯3
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
πŸ‘10❀7πŸ”₯4🀩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
❀4πŸ†4πŸ‘3πŸ”₯2🀩2