MQL5 Algo Trading
490K subscribers
3.11K photos
3.11K 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
Larry Williams’ Trade Day of the Week idea treats time as a measurable market condition: identical setups can have different odds depending on the weekday. The article tests this by isolating time as the only variable and comparing win rates per day.

A minimal MT5 research EA is built around a daily volatility breakout: compute yesterday’s range, project a buy level from today’s open, enter only on a clean 1‑minute crossover, and close at the next day’s open. No SL/TP or trade management to avoid masking weekday effects.

Implementation focuses on repeatability: new-day detection, a struct for range/level, safe position checks via magic number, and a switchable mode for baseline (all days) vs user-selected weekday filtering for controlled A/B testing.

👉 Read | Calendar | @mql5dev

#MQL5 #MT5 #EA
39👌2
This article extends the Candle Pressure Index (CPI) into a session-aware framework: prior session highs/lows act as durable reference boundaries, and CPI helps decide whether a revisit is genuine acceptance (sustained closes beyond the level with aligned pressure) or rejection (a probe beyond the level that closes back inside with a pressure flip).

The MQL5 implementation builds Tokyo/London/New York windows in broker time, handles midnight-crossing sessions, and evaluates only closed candles for deterministic behavior in both live charts and historical reconstruction. Session ranges are computed by datetime filtering, with on-demand scans to prevent the evaluation candles from contaminating the level being tested.

Signals use a two-candle model: breakout acceptance requires a CPI-validated close beyond the boundary plus a retest/hold; rejection req...

👉 Read | Docs | @mql5dev

#MQL5 #MT5 #Indicator
34🔥3👌31👀1
Part 3 completes the core CRiskManagement class for MetaTrader 5, moving from UI to a modular engine in Risk_Management.mqh that tracks losses/profits and enforces limits.

The design centers on clear enums and a Loss_Profit structure supporting fixed-money or percentage-based limits, with selectable reference metrics (balance, equity, free margin, net profit). It models daily/weekly/total loss caps, per-trade risk, and daily profit targets, plus prop-firm rules where daily loss is evaluated dynamically against equity and can expand with intraday gains (FTMO-style).

Implementation details include a CTrade wrapper, magic-number scoping, profit time windows, and lifecycle-safe constructor/destructor. Initialization and setters configure stop loss, calculation modes, and percentage application, enabling lot sizing from per-trade risk and optionally stop-...

👉 Read | Signals | @mql5dev

#MQL5 #MT5 #RiskMgmt
30👍7👌1
Part 13 replaces native chart objects with a CCanvas-based price dashboard in MQL5, combining a live mini-graph and an optional stats panel in compact, movable UI blocks.

The design focuses on interaction: mouse-driven dragging, edge/grip resizing with hover feedback, minimize/maximize controls, and dark/light theme switching. Panels redraw on new bars to keep price and account metrics current.

Implementation highlights include separate canvases for header/graph/stats, resource-backed bitmap backgrounds with opacity blending, and smooth bicubic image scaling. The graph plots recent closes with a filled line view and time labels, while the stats panel surfaces balance/equity and current bar OHLC for fast decision support.

👉 Read | CodeBase | @mql5dev

#MQL5 #MT5 #Indicator
42😁1
Multi-Mode Logarithmic Transform Indicator provides four calculation modes for price analysis using logarithmic transformations. It shifts the focus from absolute price levels to relative, percentage-based movement, improving comparability across assets with very different price scales and growth profiles.

Log Scale (Absolute) applies the natural log to the close, helping normalize exponential growth and reduce compression of older data on long histories. Trend structure reflects constant percentage change rather than constant currency increments.

Log Scale (Cumulative) builds a running sum of log returns to produce a growth curve starting from a common baseline. This supports ROI-style comparisons between instruments over the same window.

Log Returns (Difference) measures bar-to-bar momentum via the log close change. Log Volatility (Deviation) uses...

👉 Read | Docs | @mql5dev

#MQL5 #MT5 #Indicator
42👍8🤔1
Transformers replace step-by-step recurrence with self-attention, enabling parallel training and better handling of long-range dependencies than classic RNN/LSTM pipelines. For market forecasting, the focus is the Temporal Fusion Transformer: a hybrid that combines LSTM sequence modeling with attention for multi-horizon, interpretable predictions.

The workflow pulls OHLCV data from MetaTrader 5, engineers time, trend, momentum, and volatility features, then builds a PyTorch Forecasting TimeSeriesDataSet with a strict time_idx and returns as the target. Training uses PyTorch Lightning with learning-rate search and validation against a naive “last value” baseline.

Deployment wraps feature generation, training, and inference into a bot that retrains on schedule and trades from fresh predictions. Key trade-offs: GPU-friendly but compute-heavy, data-hungry, and ...

👉 Read | Forum | @mql5dev

#MQL5 #MT5 #AI
38👍2👌2
Wizard-generated multi-signal EAs can look correct in live execution but fail in the Strategy Tester due to structural issues: excessive signal voting, no market-regime awareness, and no limits on how often trades can be triggered.

The MetaQuotes signal modules are technically solid; the weakness is deployment. Fibonacci, MA, AC, and RSI each fit different conditions, yet the default design lets them vote continuously with equal weights, encouraging redundant confirmations and noisy flips between long/short.

Optimization here goes beyond parameter sweeps. Add governance layers without modifying library code: session/time filters, cooldowns, regime classification, conditional signal participation, and adaptive weighting. Then validate iteratively in the Tester with out-of-sample checks to reduce drawdown and overtrading without curve fitting.

👉 Read | Freelance | @mql5dev

#MQL5 #MT5 #EA
44👍3🎉3👌3🏆2
Part 6 extends an MQL5 RSI indicator into a configurable engine with multiple calculation variants and multi-timeframe alignment.

Supported RSI modes include classic plus Cuttler, Ehlers, Harris, quick, gradual, and RSX-style options. Inputs can be derived from close/open/high/low, composites, or internally smoothed OHLC. Pre-smoothing provides basic, growth-based, evened-out, and linear weighted averaging.

Visualization adds hue changes driven by direction, center, or boundary events. Boundaries can be static or dynamic using recent extremes. Multi-timeframe processing uses iCustom handles, buffer copying, and optional linear interpolation to align values across periods.

👉 Read | CodeBase | @mql5dev

#MQL5 #MT5 #Indicator
576👀5👌2
RiskSizer Panel Lite for MT5 is a compact chart panel focused on fixed-percentage risk sizing and fast manual execution. Lot size is estimated from a chosen Risk% of account balance, using two draggable horizontal chart lines (LOW/HIGH) as the SL/TP zone, with one-click BUY/SELL support.

For BUY: entry uses Ask, SL is LOW, TP is HIGH when HIGH is above Ask. For SELL: entry uses Bid, SL is HIGH, TP is LOW when LOW is below Bid. The panel shows spread, risk amount in account currency, calculated lots for both directions, and current line prices.

Controls include editable Risk% with configurable step buttons, a reset to restore default SL/TP distances, and an optional max-spread filter. Parameters cover risk step, default SL/TP points, max spread, deviation, magic number, and UI refresh rate. Lot sizing is approximate and balance-based; demo testing is recomme...

👉 Read | VPS | @mql5dev

#MQL5 #MT5 #EA
422👌2
“Head or Tail” is a high-risk short-term trading approach used on stocks and FX, built on random direction selection instead of market analysis. The decision is binary: buy or sell, with exits defined by time, take profit, or stop loss.

Operational flow is minimal: select an instrument, generate a random decision, open a position, then close by preset conditions. Risk management and position sizing logic are typically absent, making drawdowns structurally likely over time.

A common implementation checks that no positions are open (b + s = 0), then uses MathRand() % 2 to choose direction. Even values trigger a long order, odd values a short order, followed by an early return to stop further processing.

👉 Read | Quotes | @mql5dev

#MQL5 #MT5 #AlgoTrading
24🤣6👍3🏆3👌1
This article turns Larry Williams-style price behavior into a testable MQL5 framework instead of a fixed “one-size” scalper. The EA waits for market structure first (3-bar swing high/low with inside/outside-bar exclusions), then requires volatility expansion to trigger a breakout entry—no late fills.

Two volatility engines are supported: prior-bar range or a swing-distance comparison that picks the dominant recent move. Entry levels are projected from the current open; stops can be range-based or anchored to the swing extreme. Exits are modular: first profitable moment, time-based bar count, or risk-to-reward targets.

For research, the EA adds optional day/time filters, one-position-only enforcement, and risk-based position sizing driven by stop distance. Execution monitors intraday breakouts via 1-minute close cross logic, recalculating levels once per new...

👉 Read | Freelance | @mql5dev

#MQL5 #MT5 #EA
33👌2
Part 14 extends an MQL5 canvas-based dashboard with a scrollable text panel that avoids native object limits by rendering text at pixel level. The result is clipped, antialiased typography with a web-like scroll experience inside a CCanvas surface.

Scrolling is handled by a custom rounded scrollbar that expands on hover, includes up/down buttons, a draggable slider, and mouse-wheel support confined to the text area to prevent chart zoom conflicts. The panel respects theme toggles, background opacity, resizing, and minimization via shared event handling.

The implementation adds text wrapping based on measured font widths, line classification for headings/links/emails to apply colors, and reusable drawing utilities like rounded rectangles and color adjustment, improving both readability and UI consistency for traders and MT5 developers.

👉 Read | Calendar | @mql5dev

#MQL5 #MT5 #Indicator
32👌2👍1
In MetaTrader 5 build 5570, we have improved ONNX support in MQL5:

• Models now run significantly faster on graphics cards with CUDA support.
• New flags have been added for GPU management and logging.
• The library workflow has been revised — it is now installed only on the first launch of a program using ONNX, rather than with the platform.

In addition, we have refined the rendering of text and analytical objects on charts using the Blend2D engine introduced in the previous update. We have also improved trading reports and made the strategy tester more resilient.

The web version of the platform has received several improvements as well. When adjusting stop levels directly on a chart, you can now see an approximate profit or loss value in monetary terms. We have also fixed the display of certain trading data.

Read more...
70👍14🏆4💔2
Traditional SuperTrend variants tend to lag and generate whipsaws due to fixed ATR multipliers. SuperTrend Quant Pro Elite addresses this with Z-Score normalization, adjusting sensitivity to current volatility by widening during spikes and tightening during stable conditions.

An adaptive volatility engine recalculates the ATR multiplier in real time. Volume confluence based on tick-volume VSA confirms signals only when activity exceeds institutional averages. Regime detection classifies markets as Trending (solid line) or Choppy (dotted line) using ADX logic.

A built-in multi-timeframe dashboard reports trend state across M15, M30, H1, H4, and D1. On-chart metrics include edge probability and profit factor from the active timeframe’s history.

Signal map: green line/arrow bullish, red bearish, star marks aligned volume and trend strength, dotted line...

👉 Read | AlgoBook | @mql5dev

#MQL5 #MT5 #Indicator
423
Basic Risk Calculator targets a recurring issue in discretionary trading: consistent position sizing. An on-chart panel computes trade volume from account balance, risk percentage, and stop-loss distance, returning both lot size and risk amount in account currency.

The utility supports multiple asset classes via symbol-specific tick value handling, auto-detects balance, and rounds volume to broker lot steps. It enforces minimum and maximum volume limits to reduce order rejections, and uses event-driven updates designed to avoid platform slowdowns.

A Pro Risk Manager variant adds pending-order price entry, periodic auto-refresh, 1/2/3% presets, take-profit and risk:reward output, bidirectional price/pip conversion, tick-synced pricing, dedicated SL price input, and mode-aware field locking for error reduction.

👉 Read | AlgoBook | @mql5dev

#MQL5 #MT5 #EA
33
TrendMomentumEA is an MT5 Expert Advisor built around trend and momentum filters using EMA50/EMA200, RSI, and Stochastic. Trade logic is evaluated on the last closed candle to reduce false signals from intra-candle noise.

Directional bias is restricted to price above both EMA50 and EMA200 for longs and below both for shorts. Entries require RSI alignment plus Stochastic %K/%D crossover confirmation. A session filter limits activity to London and New York windows based on broker server time.

Execution includes single-position control per symbol and Magic Number, with configurable lot size, stop loss, and take profit. Typical use cases include major FX pairs, indices, and commodities on M15 or H1. Demo validation and server-time verification remain mandatory; behavior is trend/swing oriented rather than scalping.

👉 Read | AlgoBook | @mql5dev

#MQL5 #MT5 #EA
403
An MQL5 analytical EA automates market-state reading using only closed-candle price action, reducing the manual workload across timeframes. It treats states as descriptive context, not signals: Compression (tight, overlapping ranges), Transition (loosening structure), and Expansion (wide, volatile movement). Trend is assessed separately via swing structure and close bias.

Implementation is modular: closed-candle gating (bar 1 timestamp) ensures non-repainting and runs once per bar for stable performance. Core features include relative range comparisons, CLV for close strength and directional bias, and swing-high/low scoring.

A hierarchical classifier resolves overlaps (Expansion, then Compression, then Trend, else Transition) and optional chart overlays visualize swings, compression zones, and state history without affecting logic.

👉 Read | Docs | @mql5dev

#MQL5 #MT5 #AlgoTrading
35🏆3😎2
Part 47 extends the prior liquidity sweep/BOS EA with a Nick Rypock Trailing Reverse (NRTR) system in MQL5.

NRTR signals come from an ATR-based channel. A buy triggers when an up-support level appears after being EMPTY_VALUE on the prior bar; a sell triggers on the first down-support. Optional hedging allows opposing exposure, with MaxPositions enforcing caps.

The implementation loads the iCustom NRTR indicator, copies multiple buffers with retries, and centralizes execution in OnTick with new-bar gating. It adds auto/fixed sizing based on balance, equity, or free margin, ATR or points SL/TP, trailing modes, reversal exits, and virtual SL/TP closures.

👉 Read | Signals | @mql5dev

#MQL5 #MT5 #Strategy
32👍6
The article shows how to build custom MT5 indicators using window-function math instead of standard moving averages. Triangular windows can be derived by combining or directly computing linear coefficients, then normalized either for smoothing (MA-like) or for an oscillator that measures deviation from the mean.

It extends the idea by summing multiple sub-waves whose periods evenly divide the main period, letting developers keep low-frequency structure while controlling noise via a “number of waves” parameter. A key tradeoff is smoothing versus lag.

To reduce lag and improve responsiveness, the article introduces asymmetric sawtooth windows (LWMA as a single tooth) and multi-tooth variants that act like trend channel builders, with behavior changing for odd vs even wave counts.

Practical EAs test crossovers, historical “rewriting” crossovers with fi...

👉 Read | NeuroBook | @mql5dev

#MQL5 #MT5 #Indicator
223
GSM++ is a three-stage pipeline for graph-structured time series: hierarchical graph tokenization, local node encoding, and global dependency encoding. Hierarchical tokenization compacts topology and temporal order into sequences, improving feature extraction while reducing compute, with adjustable granularity per task.

An MQL5 implementation replaces HAC with a trainable Mixture of Tokenization using four token types per bar: node, edge, subgraph, and univariate subgraph. Tokens are fused via attention pooling (CNeuronMoT over CNeuronMHAttentionPooling). Local encoding uses Node-Adaptive Feature Smoothing to control per-node smoothing and reduce noise.

Global encoding follows a hybrid design: Chimera (2D-SSM) plus Hidformer (dual temporal/frequency streams). Testing showed excessive hold times, so CNeuronChimeraPlus adds a third 2D-SSM and rewrite...

👉 Read | Docs | @mql5dev

#MQL5 #MT5 #AlgoTrading
40
Backtests were run on H1 for XAUUSD (01/03/2025–20/01/2026) and EURUSD (01/03/2025–21/01/2026) using a hybrid system: an ONNX market-structure classifier combined with deterministic execution and risk rules.

On each new bar, six ATR-normalized and context features are fed into the model: momentum change, distance to 50-bar swing high/low, relative tick volume vs 20-bar average, candle body strength, and hour-of-day. The model returns a structure label plus probability, with signals accepted only above a 0.65 confidence threshold.

Trade direction is filtered by a 50-period SMA: longs only above, shorts only below. Entries are placed as pending limits at a Fibonacci retracement level (default 61.8%) between detected pivots, with SL beyond structure invalidation, TP at 1:2 RR, and order expiry. Exposure is capped to one position or one pending order. Trailing ...

👉 Read | VPS | @mql5dev

#MQL5 #MT5 #AI
49132