Financial time series work increasingly depends on probabilistic forecasts, not point estimates. Longer horizons amplify error accumulation, volatility sensitivity, and compute costs, especially under regime shifts driven by earnings, macro data, and geopolitics.
KΒ²VAE combines Koopman linearization, Kalman-style online correction, and a VAE for scenario generation. Tokens are built from multivariate patches to capture cross-asset interactions, then mapped into an observable space where a learned Koopman operator rolls dynamics forward.
Residuals from the linear rollout feed KalmanNet via control inputs, producing updated state and covariance per step. The decoder samples multiple future trajectories, returning distributions with confidence intervals suited for risk-aware trading and portfolio sizing.
π Read | VPS | @mql5dev
KΒ²VAE combines Koopman linearization, Kalman-style online correction, and a VAE for scenario generation. Tokens are built from multivariate patches to capture cross-asset interactions, then mapped into an observable space where a learned Koopman operator rolls dynamics forward.
Residuals from the linear rollout feed KalmanNet via control inputs, producing updated state and covariance per step. The decoder samples multiple future trajectories, returning distributions with confidence intervals suited for risk-aware trading and portfolio sizing.
π Read | VPS | @mql5dev
β€15π5π3π2
Differential Search Algorithm (DSA), proposed by Pinar Civicioglu (2012), targets continuous optimization as an alternative to PSO and DE. It maintains a population and updates candidates through directed moves with controlled randomness.
Per iteration, each agent picks a direction via B-DSA (permutation), S-DSA (top-N sampling), E1-DSA (single random leader), or E2-DSA (best leader). Step magnitude uses Gamma-distributed scaling, allowing occasional large jumps and negative steps.
A coordinate mask restores selected dimensions to previous values, then greedy selection keeps only improved candidates. Typical implementation separates Init, Moving, Revision, plus direction generation, mask creation, scale factor (Gamma RNG), and boundary control.
π Read | Forum | @mql5dev
Per iteration, each agent picks a direction via B-DSA (permutation), S-DSA (top-N sampling), E1-DSA (single random leader), or E2-DSA (best leader). Step magnitude uses Gamma-distributed scaling, allowing occasional large jumps and negative steps.
A coordinate mask restores selected dimensions to previous values, then greedy selection keeps only improved candidates. Typical implementation separates Init, Moving, Revision, plus direction generation, mask creation, scale factor (Gamma RNG), and boundary control.
π Read | Forum | @mql5dev
β€16π7π3
Moving-average inputs were extended with statistical signal processing to reduce market noise, using Independent Components Analysis (ICA) as a blind source separation step.
Pipeline used SMA-filtered OHLC data with 5-day lags, exported from MQL5 (49 columns) and modeled in Python. A surrogate target based on future SMA change aligned with raw return direction about 81% of the time, and showed improved classification accuracy as lags increased, unlike raw returns.
FastICA on 24 SMA/lag features peaked near 18 components and plateaued after ~13; 12 components were retained to control complexity. KMeans on the ICA manifold showed mostly uniform error rates, with one small, unreliable low-error cluster.
Models were tuned via RandomizedSearchCV, exported to ONNX, then loaded in an MQL5 EA alongside indicators and trade management.
π Read | NeuroBook | @mql5dev
Pipeline used SMA-filtered OHLC data with 5-day lags, exported from MQL5 (49 columns) and modeled in Python. A surrogate target based on future SMA change aligned with raw return direction about 81% of the time, and showed improved classification accuracy as lags increased, unlike raw returns.
FastICA on 24 SMA/lag features peaked near 18 components and plateaued after ~13; 12 components were retained to control complexity. KMeans on the ICA manifold showed mostly uniform error rates, with one small, unreliable low-error cluster.
Models were tuned via RandomizedSearchCV, exported to ONNX, then loaded in an MQL5 EA alongside indicators and trade management.
π Read | NeuroBook | @mql5dev
β€12π3π2
MetaTrader 5 economic calendar access in MQL5 is split across MqlCalendarCountry, MqlCalendarEvent, and MqlCalendarValue. A unified structure can simplify consumption by grouping country metadata, event definition, and release values under one record.
A provider pattern standardizes access through Get(), Exists(), Next(), and Previous(), with filters for time range, currency, country code, and importance. Next/Previous rely on bounded lookahead/lookback windows to keep calls predictable.
Strategy Tester limitations require alternative sources since calendar APIs can fail in backtests. Exporting live calendar data to CSV enables deterministic testing, while a SQLite backend scales to large history sets and supports SQL filtering. Optional in-memory caching reduces repeated DB latency during optimizations.
π Read | VPS | @mql5dev
A provider pattern standardizes access through Get(), Exists(), Next(), and Previous(), with filters for time range, currency, country code, and importance. Next/Previous rely on bounded lookahead/lookback windows to keep calls predictable.
Strategy Tester limitations require alternative sources since calendar APIs can fail in backtests. Exporting live calendar data to CSV enables deterministic testing, while a SQLite backend scales to large history sets and supports SQL filtering. Optional in-memory caching reduces repeated DB latency during optimizations.
π Read | VPS | @mql5dev
β€13π9π1
Quantora Trade Manager MT4 is a position management utility for MetaTrader 4 focused on controlling and protecting existing trades rather than generating entries. It automates routine actions including stop loss, take profit, break even, and trailing stop to reduce manual intervention and keep execution consistent.
The manager can auto-apply missing SL/TP, then move positions to break even after a configurable profit threshold. A trailing stop module can incrementally secure profit as price moves in the intended direction.
Filtering supports manual trades, all trades, or a specified Magic Number, and can run per-chart symbol or across all symbols for multi-strategy accounts. Daily protection rules allow profit targets and loss limits to trigger predefined responses. A dashboard summarizes account state, open positions, and active settings, with controls for...
π Read | Calendar | @mql5dev
The manager can auto-apply missing SL/TP, then move positions to break even after a configurable profit threshold. A trailing stop module can incrementally secure profit as price moves in the intended direction.
Filtering supports manual trades, all trades, or a specified Magic Number, and can run per-chart symbol or across all symbols for multi-strategy accounts. Daily protection rules allow profit targets and loss limits to trigger predefined responses. A dashboard summarizes account state, open positions, and active settings, with controls for...
π Read | Calendar | @mql5dev
β€15π6π1
Quantora Spread Monitor MT5 is a real-time spread monitoring indicator for MetaTrader 5. It continuously tracks current spread and records minimum, maximum, and average values to quantify changing transaction costs over time.
A built-in history graph highlights sudden spread spikes and periods of instability. Spread levels are classified from low to extreme, with configurable thresholds to match specific risk and cost limits.
Alerts trigger when the spread exceeds a defined level, with popup, sound, and push options. A cooldown mechanism reduces repeated notifications during volatile bursts.
The dashboard presents current spread, statistics, symbol details, and server time in a compact layout. It supports all symbols, updates automatically, and is designed strictly for monitoring without trade execution or signal generation.
π Read | Freelance | @mql5dev
A built-in history graph highlights sudden spread spikes and periods of instability. Spread levels are classified from low to extreme, with configurable thresholds to match specific risk and cost limits.
Alerts trigger when the spread exceeds a defined level, with popup, sound, and push options. A cooldown mechanism reduces repeated notifications during volatile bursts.
The dashboard presents current spread, statistics, symbol details, and server time in a compact layout. It supports all symbols, updates automatically, and is designed strictly for monitoring without trade execution or signal generation.
π Read | Freelance | @mql5dev
β€22π6π¨βπ»3π1
Quantora Trading Cost Calculator for MT5 estimates total trade cost before entry using live symbol data and user inputs. It aggregates spread, commission, and swap into a single view to reflect expected costs under current conditions.
Inputs include lot size, direction, commission per lot, and holding period. Output breaks down spread cost, commission cost, and swap impact, then totals the estimate in account currency. The cost is also shown as a percentage of account balance.
The panel displays tick size, tick value, and contract size to adapt calculations across instruments and broker settings. Works on all symbols and timeframes with automatic updates. Analysis-only utility with no order placement and no signal generation.
π Read | NeuroBook | @mql5dev
Inputs include lot size, direction, commission per lot, and holding period. Output breaks down spread cost, commission cost, and swap impact, then totals the estimate in account currency. The cost is also shown as a percentage of account balance.
The panel displays tick size, tick value, and contract size to adapt calculations across instruments and broker settings. Works on all symbols and timeframes with automatic updates. Analysis-only utility with no order placement and no signal generation.
π Read | NeuroBook | @mql5dev
β€18π6π1
Adaptive Kalman Trend Filter uses a single-state Kalman estimate with process noise (Q) recalculated on every bar. Q is scaled between min and max multipliers using Kaufmanβs Efficiency Ratio (ER), avoiding fixed-parameter lag versus whipsaw trade-offs. High ER raises Q and the Kalman gain, keeping the line closer to price; low ER reduces Q and increases smoothing during range conditions.
Regime bands are derived from rolling residual volatility (price minus Kalman line). Band width is the residual standard deviation times a multiplier that is further expanded as ER falls, producing tighter bands in directional markets and wider bands in chop. Color state changes are confirmed on closed bars only, so signals do not repaint.
Key inputs include base Q, measurement noise (R), ER/band lookbacks, regime threshold, and band multiplier. Typical tuning targets...
π Read | Freelance | @mql5dev
Regime bands are derived from rolling residual volatility (price minus Kalman line). Band width is the residual standard deviation times a multiplier that is further expanded as ER falls, producing tighter bands in directional markets and wider bands in chop. Color state changes are confirmed on closed bars only, so signals do not repaint.
Key inputs include base Q, measurement noise (R), ER/band lookbacks, regime threshold, and band multiplier. Typical tuning targets...
π Read | Freelance | @mql5dev
β€20π6β‘2π2π1
SessionORB_EA automates an opening-range breakout around a configurable session start (London, New York, or any custom broker-time open). It records the high/low of the first N minutes using M1 data, then maintains two trigger levels at the range boundaries plus an optional buffer.
A trade is placed only after a bar closes beyond a trigger, not on a wick. One market position per session is allowed by default, with position sizing based on account risk percent or an optional fixed lot. Stop loss is set beyond the opposite side of the range with an added buffer, and take profit is defined by a reward-to-risk multiple.
The range measurement stays minute-accurate regardless of chart timeframe, while signal confirmation follows the attached chart period. Chart objects can draw the opening-range box, forward trigger lines, and a session-start marker, with automat...
π Read | VPS | @mql5dev
A trade is placed only after a bar closes beyond a trigger, not on a wick. One market position per session is allowed by default, with position sizing based on account risk percent or an optional fixed lot. Stop loss is set beyond the opposite side of the range with an added buffer, and take profit is defined by a reward-to-risk multiple.
The range measurement stays minute-accurate regardless of chart timeframe, while signal confirmation follows the attached chart period. Chart objects can draw the opening-range box, forward trigger lines, and a session-start marker, with automat...
π Read | VPS | @mql5dev
β€22π8β‘2π2
Reverse RSI Bands is a custom indicator that reverse-engineers the RSI equation and plots the exact price levels where RSI will reach selected overbought and oversold thresholds. Instead of a separate oscillator window, the main chart shows the calculated upper and lower price bands, enabling advance identification of potential extremes and dynamic support/resistance zones.
The implementation uses algebraic deductions of Wilderβs recursive smoothing and computes the required price for the current bar from the verified previous-bar state, preventing repainting. The resulting levels are designed to match the platformβs standard RSI output exactly.
Key inputs include RSI period (default 14), overbought target (70), oversold target (30), and applied price (close). Common usage focuses on major FX pairs on H1/H4, watching for touches or pierces of the ban...
π Read | AppStore | @mql5dev
The implementation uses algebraic deductions of Wilderβs recursive smoothing and computes the required price for the current bar from the verified previous-bar state, preventing repainting. The resulting levels are designed to match the platformβs standard RSI output exactly.
Key inputs include RSI period (default 14), overbought target (70), oversold target (30), and applied price (close). Common usage focuses on major FX pairs on H1/H4, watching for touches or pierces of the ban...
π Read | AppStore | @mql5dev
β€28π7π₯2π¨βπ»2π1
KΒ²VAE targets time-series forecasting under high uncertainty by combining linear latent dynamics (Koopman), adaptive error filtering (KalmanNet), and probabilistic sampling (VAE). Output is a full distribution of future states, with variance reflecting confidence rather than a single trajectory.
Architecture splits into patching, encoder, and decoder. The decoder returns mean and variance to model P(Y|Z) and preserve uncertainty end-to-end.
The encoder chains KoopmanNet for latent transitions and retrospective reconstruction, attention over reconstruction error (not the raw sequence), KalmanNet to generate a covariance matrix from error-derived control signals, and VAE sampling using Koopman mean plus Kalman dispersion.
KoopmanNet can be extended from dual MLPs to a sparse Mixture-of-Experts block to separate local vs global dynamics and improve robustness on vo...
π Read | Signals | @mql5dev
Architecture splits into patching, encoder, and decoder. The decoder returns mean and variance to model P(Y|Z) and preserve uncertainty end-to-end.
The encoder chains KoopmanNet for latent transitions and retrospective reconstruction, attention over reconstruction error (not the raw sequence), KalmanNet to generate a covariance matrix from error-derived control signals, and VAE sampling using Koopman mean plus Kalman dispersion.
KoopmanNet can be extended from dual MLPs to a sparse Mixture-of-Experts block to separate local vs global dynamics and improve robustness on vo...
π Read | Signals | @mql5dev
β€12π9π1π1
This article outlines an MVP βLLM-driven traderβ built with Python + MetaTrader 5 + an OpenRouter-connected language model. MT5 supplies recent OHLCV candles, the script packages them into a prompt, and the LLM returns a structured decision: BUY/SELL/WAIT plus entry, SL/TP, and a short rationale.
Key implementation details: cloud inference keeps hardware requirements low; model choice is swappable via a single API parameter; responses are parsed with regex to tolerate formatting drift; orders are placed as MT5 market trades with a 1:2 risk/reward, and each cycle runs on a timer (e.g., every 5 minutes) with full logging.
Practical takeaways: strategy iteration happens mostly in prompt design and model settings (temperature, max_tokens), multi-timeframe inputs can improve context, and production use needs guardrails for open-position handling, latency, and...
π Read | Forum | @mql5dev
Key implementation details: cloud inference keeps hardware requirements low; model choice is swappable via a single API parameter; responses are parsed with regex to tolerate formatting drift; orders are placed as MT5 market trades with a 1:2 risk/reward, and each cycle runs on a timer (e.g., every 5 minutes) with full logging.
Practical takeaways: strategy iteration happens mostly in prompt design and model settings (temperature, max_tokens), multi-timeframe inputs can improve context, and production use needs guardrails for open-position handling, latency, and...
π Read | Forum | @mql5dev
β€11π3β‘1π1
Most MT5 indicators lean on mean, standard deviation, and least-squares regression, which collapse under outliers: a single bad tick or gap can drag the mean, inflate volatility, and even flip a regression slope.
A robust alternative replaces those estimators with median, MAD (scaled by 1.4826 to match sigma on clean data), and Theil-Sen slope (median of pairwise slopes). These keep meaning until a large fraction of the window is corrupted, unlike classical tools with effectively zero tolerance.
The core is a single include, RobustStats.mqh, using a ring buffer for O(1) updates and a one-pass ComputeAll() that returns robust and classical metrics over the same window for fair comparison. Three drop-in indicators mirror bands, channels, and oscillators, plus an overlay and a breakdown-point script to quantify stability and highlight edge cases (NaNs, ...
π Read | VPS | @mql5dev
A robust alternative replaces those estimators with median, MAD (scaled by 1.4826 to match sigma on clean data), and Theil-Sen slope (median of pairwise slopes). These keep meaning until a large fraction of the window is corrupted, unlike classical tools with effectively zero tolerance.
The core is a single include, RobustStats.mqh, using a ring buffer for O(1) updates and a one-pass ComputeAll() that returns robust and classical metrics over the same window for fair comparison. Three drop-in indicators mirror bands, channels, and oscillators, plus an overlay and a breakdown-point script to quantify stability and highlight edge cases (NaNs, ...
π Read | VPS | @mql5dev
β€7π2π1
Running one EA per symbol hides portfolio risk: correlated pairs can stack exposure, turning multiple βsafeβ trades into one concentrated drawdown. The article proposes a masterβslave architecture to coordinate trading across symbols.
A Portfolio Controller (master) holds no positions; it computes equity-based risk budget, enforces drawdown kill switches, and broadcasts limits. Instrument Agents (slaves) generate signals per symbol but must query shared limits before any order, separating strategy code from capital governance.
State sharing uses MT5 global variables for low-latency scalar flags (budget, max lots, halt), with named pipes or files reserved for structured, slower updates. A readiness handshake prevents trading on uninitialized state, timers drive controller updates, and degraded mode keeps agents running conservatively if the controller dis...
π Read | Freelance | @mql5dev
A Portfolio Controller (master) holds no positions; it computes equity-based risk budget, enforces drawdown kill switches, and broadcasts limits. Instrument Agents (slaves) generate signals per symbol but must query shared limits before any order, separating strategy code from capital governance.
State sharing uses MT5 global variables for low-latency scalar flags (budget, max lots, halt), with named pipes or files reserved for structured, slower updates. A readiness handshake prevents trading on uninitialized state, timers drive controller updates, and degraded mode keeps agents running conservatively if the controller dis...
π Read | Freelance | @mql5dev
π9β€2
Aggregate stats in MQL5 signals can hide trade sequencing. Win rate, profit factor, drawdown, and a smooth equity curve summarize outcomes, not sizing and exposure mechanics.
A native MT5 auditor is proposed to grade βHidden Risk-of-Ruinβ from A to F using four checks on reconstructed closed positions: volume escalation after losses (martingale), overlapping same-direction entries at worsening prices (grid), payoff asymmetry (small wins vs rare large losses), and a classical risk-of-ruin estimate for a chosen risk-per-trade.
Implementation is split into two scripts: an exporter that rebuilds positions from deal history into CSV, and an auditor that loads CSV or runs a reproducible demo and prints findings in the Experts tab. No external dependencies.
π Read | CodeBase | @mql5dev
A native MT5 auditor is proposed to grade βHidden Risk-of-Ruinβ from A to F using four checks on reconstructed closed positions: volume escalation after losses (martingale), overlapping same-direction entries at worsening prices (grid), payoff asymmetry (small wins vs rare large losses), and a classical risk-of-ruin estimate for a chosen risk-per-trade.
Implementation is split into two scripts: an exporter that rebuilds positions from deal history into CSV, and an auditor that loads CSV or runs a reproducible demo and prints findings in the Experts tab. No external dependencies.
π Read | CodeBase | @mql5dev
π4π1
CustomAverage implements a two-stage adaptive moving average: a selectable base MA on price, followed by an independent smoothing MA applied to the base output. This setup improves responsiveness versus a single long MA while keeping the line more stable than a short MA.
The plot is slope-colored, switching based on bar-to-bar direction. Optional arrows mark close/average crossovers: bullish when the close moves from below to above the line, bearish on the reverse. A corner label prints the current average value.
The calculation runs left-to-right on closed bars only, with no future data usage and no historical repainting. Updates use prev_calculated logic to recompute only changed bars, keeping runtime low on deep histories and small timeframes.
Key inputs include MA periods, MA methods (SMA/EMA/SMMA/LWMA), applied price, signal toggles, arrow code...
π Read | AppStore | @mql5dev
The plot is slope-colored, switching based on bar-to-bar direction. Optional arrows mark close/average crossovers: bullish when the close moves from below to above the line, bearish on the reverse. A corner label prints the current average value.
The calculation runs left-to-right on closed bars only, with no future data usage and no historical repainting. Updates use prev_calculated logic to recompute only changed bars, keeping runtime low on deep histories and small timeframes.
Key inputs include MA periods, MA methods (SMA/EMA/SMMA/LWMA), applied price, signal toggles, arrow code...
π Read | AppStore | @mql5dev
β€3π3
MetaTrader 5 trendlines are purely graphical, so EAs canβt natively detect touches, bounces, or meaningful breakouts. This article bridges that gap by wrapping each chart trendline into a managed runtime entity with identity, memory, and a controlled lifecycle.
The design is event-driven for user actions (create/drag/modify) and confirmation-driven for market logic, using closed candles to avoid intrabar noise. States progress through active, touched/pending, bounced, and broken, with configurable thresholds for proximity, volatility, and consecutive closes.
Responsibilities are split cleanly: chart synchronization, geometry projection, lifecycle decisions, and visual debugging (color-coded states). A central manager discovers existing objects, maintains a collection of managed trendlines, and coordinates updates across multiple lines.
π Read | Freelance | @mql5dev
The design is event-driven for user actions (create/drag/modify) and confirmation-driven for market logic, using closed candles to avoid intrabar noise. States progress through active, touched/pending, bounced, and broken, with configurable thresholds for proximity, volatility, and consecutive closes.
Responsibilities are split cleanly: chart synchronization, geometry projection, lifecycle decisions, and visual debugging (color-coded states). A central manager discovers existing objects, maintains a collection of managed trendlines, and coordinates updates across multiple lines.
π Read | Freelance | @mql5dev
β€5π4π1π¨βπ»1