Linear price charts distort percentage-based trends, making straight regression channels systematically misaligned. A log-price fit keeps constant-percent growth linear in the model, then renders the result back on a standard chart as a curve with adaptive banding.
The indicator re-evaluates only on bar close and selects its own look-back by testing 19 candidate windows and choosing the highest log-price correlation, with ties resolved toward the shorter window. Invalid windows (insufficient history or non-positive prices) are skipped.
Output includes a midline plus deviation-based edges that stay a fixed percentage from the trend, zone shading by distance from the midline, and a forward projection for 6β60 bars. A status card reports direction, best window, correlation grade, growth rate per calendar time, and live distance from the midline in devia...
π Read | AlgoBook | @mql5dev
The indicator re-evaluates only on bar close and selects its own look-back by testing 19 candidate windows and choosing the highest log-price correlation, with ties resolved toward the shorter window. Invalid windows (insufficient history or non-positive prices) are skipped.
Output includes a midline plus deviation-based edges that stay a fixed percentage from the trend, zone shading by distance from the midline, and a forward projection for 6β60 bars. A status card reports direction, best window, correlation grade, growth rate per calendar time, and live distance from the midline in devia...
π Read | AlgoBook | @mql5dev
π11β€5π€©4π₯2
A practical workflow for forecasting whether EURUSD will have an unusually large 08:00β16:00 session range, using only information available at 08:00. βLarge rangeβ is defined relative to recent conditions: 25% above the mean range of the prior 20 valid target sessions.
A binary logistic regression is fit in SPSS on 2020β2023 data with two pre-session features: morning range relative to the historical scale, and the pre-session open-close move normalized by that range. The model is frozen and evaluated on a 2024 holdout.
Forecast quality is measured as probabilities, compared against constant and rolling-frequency baselines using Brier score, log loss, and calibration groups. The same probability math is reproduced in MQL5 with a numerically stable sigmoid, plus auditing rules to ensure sessions are valid and results are reproducible.
π Read | Forum | @mql5dev
A binary logistic regression is fit in SPSS on 2020β2023 data with two pre-session features: morning range relative to the historical scale, and the pre-session open-close move normalized by that range. The model is frozen and evaluated on a 2024 holdout.
Forecast quality is measured as probabilities, compared against constant and rolling-frequency baselines using Brier score, log loss, and calibration groups. The same probability math is reproduced in MQL5 with a numerically stable sigmoid, plus auditing rules to ensure sessions are valid and results are reproducible.
π Read | Forum | @mql5dev
β€10π10π₯6π€©4π¨βπ»2π1
A free MT5 Risk/Reward Calculator script is available for position sizing and risk control. It calculates lot size from a defined risk percentage and stop-loss distance, then renders an on-chart dashboard to avoid manual math.
The panel shows computed lot size, monetary risk in account currency, stop loss, take profit, and the resulting risk-to-reward ratio. Calculation can be based on account balance or equity.
Instrument handling is automatic by reading tick value, tick size, and broker lot step, with support across FX, metals, indices, and crypto.
Inputs cover risk percentage, stop-loss and take-profit distances, balance vs equity selection, and basic display options such as panel position and colors. The script is informational only and does not place orders.
π Read | Freelance | @mql5dev
The panel shows computed lot size, monetary risk in account currency, stop loss, take profit, and the resulting risk-to-reward ratio. Calculation can be based on account balance or equity.
Instrument handling is automatic by reading tick value, tick size, and broker lot step, with support across FX, metals, indices, and crypto.
Inputs cover risk percentage, stop-loss and take-profit distances, balance vs equity selection, and basic display options such as panel position and colors. The script is informational only and does not place orders.
π Read | Freelance | @mql5dev
π7β€6π₯3π€©2
TradingCostPlanner is an MQL5 Expert Advisor that estimates how much of an expected favorable move remains after spread. It uses the chart symbolβs live Bid/Ask plus an exit-spread assumption, producing scenario outputs in points, not profit, and excluding commission, swap, and slippage.
Two spread-only estimates are compared. One assumes the current spread at exit. The other uses the greater of the current spread and a percentile computed from recent tick-history samples. Both apply the planned midpoint move, where entry and exit each contribute half of their assumed spreads.
The EA validates inputs, checks volume against symbol constraints, rejects stale quotes, and refreshes tick history on a timer. A collapsible panel separates unavailable data from valid projections and shows execution readiness independently.
An optional Execute action can submit a mar...
π Read | CodeBase | @mql5dev
Two spread-only estimates are compared. One assumes the current spread at exit. The other uses the greater of the current spread and a percentile computed from recent tick-history samples. Both apply the planned midpoint move, where entry and exit each contribute half of their assumed spreads.
The EA validates inputs, checks volume against symbol constraints, rejects stale quotes, and refreshes tick history on a timer. A collapsible panel separates unavailable data from valid projections and shows execution readiness independently.
An optional Execute action can submit a mar...
π Read | CodeBase | @mql5dev
β€12π10π€©5π₯4
Financial tick streams remain difficult to model with fixed-interval sampling. Event-driven architectures fit better when activity is irregular and noise dominates.
SDformerFlow combines spiking neurons with windowed attention, using shifted windows to limit attention cost while still capturing broader dependencies. Spikes trigger computation only on significant changes, reducing redundant work.
During an MQL5 port, the windowed layout and sparse activation mapped well to OpenCL parallelization. Encoder work centered on SDSA blocks and SPM patch-merge stages.
Current work moves to a U-shaped design with symmetric encoder/decoder flow. Instead of separate branches, a nested U-block is used to simplify tensor routing and maintenance. A new CNeuronSDformerUBlock encapsulates encoder, neck recursion, concatenation, and decoder, terminating in an MS-ResBlock...
π Read | Freelance | @mql5dev
SDformerFlow combines spiking neurons with windowed attention, using shifted windows to limit attention cost while still capturing broader dependencies. Spikes trigger computation only on significant changes, reducing redundant work.
During an MQL5 port, the windowed layout and sparse activation mapped well to OpenCL parallelization. Encoder work centered on SDSA blocks and SPM patch-merge stages.
Current work moves to a U-shaped design with symmetric encoder/decoder flow. Instead of separate branches, a nested U-block is used to simplify tensor routing and maintenance. A new CNeuronSDformerUBlock encapsulates encoder, neck recursion, concatenation, and decoder, terminating in an MS-ResBlock...
π Read | Freelance | @mql5dev
β€12π€©6π₯5
COA tackles trading-system parameter tuning where brute-force search fails: a noisy, multimodal profit landscape that punishes single-swarm convergence.
Instead of one population collapsing to one point, COA splits candidates into mostly stable packs. Each pack follows its own alpha (local best) and a βcultureβ defined by the coordinate-wise median, which resists outliers and keeps exploration grounded.
Updates combine two pulls: toward the alpha and toward the median, using random pack members as references. Step size shrinks naturally as a pack tightens, and moves are accepted only when fitness improves.
Diversity is reinforced by per-pack pup generation: crossover between two parents with a low, dimension-scaled mutation rate. Rare inter-pack swaps spread successful traits without homogenizing the search, making it practical for robust MT5 optimizations.
π Read | Forum | @mql5dev
Instead of one population collapsing to one point, COA splits candidates into mostly stable packs. Each pack follows its own alpha (local best) and a βcultureβ defined by the coordinate-wise median, which resists outliers and keeps exploration grounded.
Updates combine two pulls: toward the alpha and toward the median, using random pack members as references. Step size shrinks naturally as a pack tightens, and moves are accepted only when fitness improves.
Diversity is reinforced by per-pack pup generation: crossover between two parents with a low, dimension-scaled mutation rate. Rare inter-pack swaps spread successful traits without homogenizing the search, making it practical for robust MT5 optimizations.
π Read | Forum | @mql5dev
β€15π10π₯6π€©4π¨βπ»2
Perceptron training is moved from least-squares updates to gradient-based updates, keeping the same squared-error loss while changing how weights and bias are adjusted.
The gradient is treated as a vector: it indicates steepest increase; using the negative direction reduces loss. Implementation relies on partial derivatives for bias and each weight, rather than a secant-style update often confused with a tangent approach.
Code changes focus on accumulating per-sample error, computing a shared term for bias/weights, then scaling weight gradients by the corresponding input value. Bias uses a constant derivative of 1.
Training loops until the loss drops below a threshold, applying a learning rate and tracking the maximum component error to avoid premature stopping and uniform weight steps.
π Read | Calendar | @mql5dev
The gradient is treated as a vector: it indicates steepest increase; using the negative direction reduces loss. Implementation relies on partial derivatives for bias and each weight, rather than a secant-style update often confused with a tangent approach.
Code changes focus on accumulating per-sample error, computing a shared term for bias/weights, then scaling weight gradients by the corresponding input value. Bias uses a constant derivative of 1.
Training loops until the loss drops below a threshold, applying a learning rate and tracking the maximum component error to avoid premature stopping and uniform weight steps.
π Read | Calendar | @mql5dev
β€7π€©6π5π₯5
Classic SuperTrend on MT5 is built on fixed ATR period and multiplier. When regime or volatility shifts, those constants produce narrow bands and whipsaws, or wide bands and delayed reversals. Manual retuning and one-shot optimizations both fail because parameters stay static while conditions change.
An adaptive design replaces constants with live calibration. A background probe matrix scores 5-bar outcomes, tracks MAE, and updates ATR period, multiplier, SL/TP with deadband control and EWM smoothing. A 2D regime grid (trend/sideways vs normalized volatility) stores decayed statistics per cell and returns stable 3x3 neighborhood recommendations.
Signal quality is gated by an accuracy layer: EMA8/EMA21 spread, ADX floor, Keltner squeeze block, candle body confirmation, plus a weighted confidence score. L1 regularization zeroes weak feature weights to ...
π Read | CodeBase | @mql5dev
An adaptive design replaces constants with live calibration. A background probe matrix scores 5-bar outcomes, tracks MAE, and updates ATR period, multiplier, SL/TP with deadband control and EWM smoothing. A 2D regime grid (trend/sideways vs normalized volatility) stores decayed statistics per cell and returns stable 3x3 neighborhood recommendations.
Signal quality is gated by an accuracy layer: EMA8/EMA21 spread, ADX floor, Keltner squeeze block, candle body confirmation, plus a weighted confidence score. L1 regularization zeroes weak feature weights to ...
π Read | CodeBase | @mql5dev
β€17π€©11π₯9π5
Perceptron mechanics are often obscured by terminology. Forward propagation is the weighted sum plus bias followed by an activation function, producing an output passed to other units or exposed to callers.
Training adjusts weights and bias. With least squares on linear regression, the identity activation is the consistent choice; other activations change the problem definition. Test scaffolding can isolate training, logging, and convergence checks.
Learning rate remains the main stability control. Too high causes oscillation around minima; too low slows convergence. A max-iteration guard prevents non-terminating runs.
For gradient-based updates, the key addition is multiplying the backpropagated error term by the derivative of the activation function. This is the practical boundary between forward computation and backprop.
π Read | Signals | @mql5dev
Training adjusts weights and bias. With least squares on linear regression, the identity activation is the consistent choice; other activations change the problem definition. Test scaffolding can isolate training, logging, and convergence checks.
Learning rate remains the main stability control. Too high causes oscillation around minima; too low slows convergence. A max-iteration guard prevents non-terminating runs.
For gradient-based updates, the key addition is multiplying the backpropagated error term by the derivative of the activation function. This is the practical boundary between forward computation and backprop.
π Read | Signals | @mql5dev
π₯14β€12π€©7π6
Trade refusals in MT5 often slip past logs, even after common βrulebookβ checks. The article builds a drop-in preflight gate, CTradePreflight, that validates and optionally repairs trade requests before OrderSend(), with unit tests and a repeatable stress EA.
The pipeline separates broker-free rules (volume step/min/max, tick-size grid, stop/freeze constraints) from live-terminal checks (permissions, sessions, volume limits, margin) and finishes with OrderCheck(). Repairs round volume down without increasing risk, and can widen stops only when explicitly allowed. A ledger tracks every refusal reason.
A key finding: with tester execution delay, some requests still fail because price shifts between validation and server processing. A configurable delay buffer adds safety by requiring extra distance from market, trading fewer borderline orders to avoi...
π Read | VPS | @mql5dev
The pipeline separates broker-free rules (volume step/min/max, tick-size grid, stop/freeze constraints) from live-terminal checks (permissions, sessions, volume limits, margin) and finishes with OrderCheck(). Repairs round volume down without increasing risk, and can widen stops only when explicitly allowed. A ledger tracks every refusal reason.
A key finding: with tester execution delay, some requests still fail because price shifts between validation and server processing. A configurable delay buffer adds safety by requiring extra distance from market, trading fewer borderline orders to avoi...
π Read | VPS | @mql5dev
β€23π€©14π₯7π6
A running CA with 10,000 MT5 agents hit two quality bottlenecks: 50 inputs treated as unrelated scalars, and a Moore lattice that spreads regime shifts slowly while connecting semantically unrelated cells. The upgrade targets only ExtractFeatures() plus neighbor selection and voting, keeping OnTick() fast and the EA interface unchanged.
Features become a 50-node graph: a lightweight diffusion step blends each feature with predefined semantic neighbors and a few small-world links. Implemented via index lists (no matrices, no training), this acts like a spectral filter that damps isolated indicator spikes and reinforces coherent multi-indicator structures.
Cells also move from pure geometry to a hybrid network: some local neighbors remain, but others are semantic (same feature group, similar strategy) plus long-range chords. Voting weights add a coherenc...
π Read | CodeBase | @mql5dev
Features become a 50-node graph: a lightweight diffusion step blends each feature with predefined semantic neighbors and a few small-world links. Implemented via index lists (no matrices, no training), this acts like a spectral filter that damps isolated indicator spikes and reinforces coherent multi-indicator structures.
Cells also move from pure geometry to a hybrid network: some local neighbors remain, but others are semantic (same feature group, similar strategy) plus long-range chords. Voting weights add a coherenc...
π Read | CodeBase | @mql5dev
β€14π7π€©5π₯2
MetaTrader 5 ML workflows often end up with duplicated artifacts across dev machines and VPS instances. Centralizing models and feature snapshots in S3 is practical, but MQL5 has no AWS SDK and S3 requires SigV4 on every request.
A native SigV4 implementation can be built using only CryptEncode() and WebRequest(), avoiding DLL dependencies that are blocked in many sandboxed terminals. This still relies on WebRequest() allow-list and local TLS/network policy.
Scope is limited to PutObject, GetObject, and ListObjectsV2, implemented as three files: a signer (canonical request, manual HMAC-SHA256, signing-key derivation), an S3 client wrapper, and a script that uploads ONNX/CSV, downloads them back, and validates SHA-256 round trips. The signed headers set is minimal and excludes session tokens and service-specific headers.
π Read | NeuroBook | @mql5dev
A native SigV4 implementation can be built using only CryptEncode() and WebRequest(), avoiding DLL dependencies that are blocked in many sandboxed terminals. This still relies on WebRequest() allow-list and local TLS/network policy.
Scope is limited to PutObject, GetObject, and ListObjectsV2, implemented as three files: a signer (canonical request, manual HMAC-SHA256, signing-key derivation), an S3 client wrapper, and a script that uploads ONNX/CSV, downloads them back, and validates SHA-256 round trips. The signed headers set is minimal and excludes session tokens and service-specific headers.
π Read | NeuroBook | @mql5dev
β€7π2π₯2π€©1