MQL5 Algo Trading
488K subscribers
3.08K photos
3.09K 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
Last Structure Indicator (Single Phase) implements a framework to test the Last Structure Break (LSB) concept using structured price-action rules.

Session boundaries are detected via logical day separation, based on chart separators and datetime normalization rather than daily timeframe data. This keeps day transitions consistent across timeframes and broker feeds.

The scan builds support/resistance pivots with configurable modes (wick-based or body-based) and pivot strength validation using left/right bar requirements. Only the final structural levels of a session that remain unbroken into the close are accepted, then projected forward as trendlines into the next session.

Designed for real-time use with minimal recalculation, the tool aims to measure whether end-of-session structure has repeatable relevance for subsequent price action.

πŸ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #Indicator
❀41πŸ‘Œ3πŸ”₯2
This article breaks down how to consistently identify Premium/Discount (PD) arrays and imbalances in price action, and why traders fail when they pick the wrong β€œreaction zones” or trade against the broader narrative. It emphasizes using a simple checklist mindset to reduce impulse entries and indecision.

Core concepts are defined practically: imbalances as fast, one-sided moves that often get revisited; market structure shifts as decisive breaks that flip highs/lows; PD arrays as splitting an expansion leg into premium vs discount to avoid buying high or selling low; and using fractal behavior to refine higher-timeframe ideas into lower-timeframe entries.

A MetaTrader 5 EA in MQL5 is presented to automate this workflow: detect trend and consolidation with stacked moving averages, map higher-timeframe expansion legs into PD zones, track imbalances inside th...

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #EA
❀82πŸ‘Œ14πŸ‘€4⚑3🀝3
An updated Limit Channels indicator adds a β€œstates” panel rendered as a colored histogram to summarize channel conditions.

States are derived from three nested level groups. Level 3 uses the outer bands and represents the slowest state. Level 2 uses the middle bands. Level 1 uses the inner bands and reacts fastest.

The six total levels allow additional combinations beyond the default three-state mapping. Color transitions in the histogram can be used as event markers, with signal rules left to the implementer based on timeframe, instrument, and risk constraints.

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #Indicator
❀34πŸ‘€4🀯3
ALGLIB’s MQL5 port ships minLBFGS but lacks a box-constrained variant, pushing developers toward heavier optimizers for simple bound-limited calibration tasks. A compact Truncated Newton Conjugate-Gradient (TNC) solver fills that gap with an API designed to drop into projects like minLBFGS.

TNC approximates Newton steps using an inner Conjugate Gradient loop, relying on Hessian-vector products derived from gradient finite differences instead of forming a full Hessian. It supports analytic gradients when available, plus stable numerical differentiation near bounds, while enforcing constraints via projection and variable clamping.

The implementation is packaged as tnc.mqh with a CFunctor/CTruncNewtonCG interface, tunable stopping criteria, and clear termination codes. It’s validated on Rosenbrock and used to fit logistic regression alongside LBFGS, pro...

πŸ‘‰ Read | AlgoBook | @mql5dev

#MQL5 #MT5 #algorithm
❀92πŸ‘7⚑4😁2πŸ‘€2
A trend indicator is used to classify market direction as uptrend or downtrend based on the line state.

Common operational logic is straightforward: a green line is treated as a bullish condition and a red line as a bearish condition. Some traders use this as a basic ruleset to align entries and exits with the prevailing direction.

For practical use, results depend on the instrument, timeframe, and parameter settings. As with any single-signal approach, confirmation with volatility, volume, or higher-timeframe structure is typically required to reduce false signals.

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #Indicator
❀48✍6⚑3
This MQL5 binomial distribution viewer evolves from a 2D canvas into a Direct3D-backed tool that can switch between 2D and 3D at runtime. The goal is practical: make frequency differences and PMF shape easier to inspect using depth, perspective, and camera control instead of restarting or redrawing separate views.

The implementation adds CCanvas3D plus DXBox primitives, a view-mode enum, and configurable inputs for camera, ground plane, and axis styling. The codebase is refactored into a single visualizer class that centralizes state, data arrays, and interaction logic, with a destructor that explicitly releases GPU resources.

On the 3D side, histogram bins become box meshes updated via scaling/translation matrices, with an auto-fit camera derived from scene bounds. Mouse interactions handle rotation and zoom, while 2D overlays (header, legend, swit...

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀42πŸ‘5πŸ‘Œ5πŸ†5⚑4πŸ‘3
An updated version of the MetaTrader 4 platform will be released on Friday, March 13, 2026. This build includes improved interface translations, bug fixes, and enhanced platform stability.

The update will be distributed via Live Update.

Discuss the update...
❀79πŸ‘18πŸ’―10πŸ”₯8πŸ€”4πŸ‘Œ3🀑2
An MT4 version of the Limit Channels indicator has been published.

The release targets traders and developers maintaining MT4 stacks that require channel-based boundary calculations with configurable limits. Typical usage includes defining dynamic upper and lower bands and tracking price interaction with those levels for alerts or signal logic.

Implementation details, parameters, and example configurations are available at the referenced source.

πŸ‘‰ Read | Quotes | @mql5dev

#MQL4 #MT4 #Indicator
❀38πŸ‘5πŸ‘1πŸ‘Œ1πŸ‘€1
Symbol discipline fails when a solid strategy is applied to the wrong instrument. This MQL5 solution enforces a strict symbol whitelist at the execution layer, blocking both manual and EA trades on non-approved symbols using OnTradeTransaction.

The design is modular: a shared include file centralizes whitelist parsing, case-insensitive validation, and file I/O; an indicator dashboard writes the approved universe and displays status plus recent blocks; an enforcement EA reacts to ORDER_ADD and DEAL_ADD events to cancel pending orders or flatten positions.

Configuration is persisted in a plain text file, blocked actions are audited to CSV, and components synchronize via shared storage. Result: strategy scope stays aligned with backtests, exposure can’t silently expand, and every violation is traceable.

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀73πŸ‘5πŸ€”5πŸ”₯3πŸŽ‰3
A minimal channel tool can be built from recent high/low values with band spacing derived from ATR. The result is a dynamic range framework that adapts to volatility and updates with each bar.

In practice, these bands are more suitable for estimating short-term support and resistance than for generating entries. They can also serve as consistent reference levels for take-profit and stop-loss placement in systems that already define direction and timing.

This setup is intended for trend context, range boundaries, and risk parameterization, not as a standalone signal source.

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #Indicator
❀35πŸ”₯2😈1
This article turns discretionary price action into a testable model by representing confirmed swing highs/lows as nodes and swing transitions as edges in a market-structure graph. Depth-First Search is then used to β€œcommit” to one structural branch (higher highs/lows or lower lows/highs), only accepting a directional bias after a minimum path depth confirms continuation.

The EA implements this in MQL5 with configurable swing sensitivity, minimum depth, target tolerance, and either fixed-lot or risk-based sizing. Key invalidation levels (last higher low / last lower high) make trend failure deterministic: if broken, the system backtracks, clears state, and searches for an alternate path.

Operationally, the design emphasizes longevity: daily resets, capped node storage, array resizing, and cleanup on deinit keep the swing graph and DFS state stable d...

πŸ‘‰ Read | AlgoBook | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀33πŸ‘Œ4πŸ”₯1
Quant research keeps producing backtests with high Sharpe, low drawdown, and immediate live failure. The main driver is overfitting through multiple channels, not a single mistake fixed by a basic train/test split.

Common failure modes include data snooping across many candidates, curve-fitting to path-specific noise, and accumulated researcher degrees of freedom during iterative tuning.

Three controls target different layers. Validation-within-Validation enforces outer training, inner validation, and a one-time final test, often with anchored walkforward. CPCV removes temporal leakage via purging and embargoing, then evaluates combinatorial OOS paths. CSCV audits selection with Probability of Backtest Overfitting, reporting how often the in-sample winner ranks poorly out-of-sample.

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀35πŸ‘Œ2πŸ‘¨β€πŸ’»1
The article shifts a retail stat-arb workflow from SQLite (OLTP) to DuckDB-backed analytics using Parquet files, keeping mean-reversion and sub-second HFT out of scope. The goal is faster research loops: qualify ideas in seconds before spending time on full MT5 EA backtests.

It shows how to export an entire SQLite database or selected tables to Parquet via DuckDB, then query those files directly with SQL or Python’s lazy relational API.

Key technical gains come from Parquet’s columnar layout, embedded min/max statistics, compression, and DuckDB’s zero-copy reads, which reduce I/O and skip irrelevant files.

For scalable history storage, the plan is to denormalize price data and adopt Hive-style partitioning (source, asset class, ticker, timeframe, year, month) to keep datasets portable and easy to merge across brokers and providers.

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀43πŸ‘Œ5πŸ‘Ύ2
ExMachina Trade Pilot is an MT5 expert advisor focused on order execution and position lifecycle management from a single control panel. It targets common platform gaps: partial take-profits, automated breakeven, and trailing logic beyond fixed-point trails.

The workflow consolidates risk-based lot sizing, SL/TP placement, and multi-stage exits. Up to three take-profit levels can be configured with independent close percentages; each hit triggers an automatic partial close with logging and live status tracking.

Management tools include ATR-based, fixed-point, and previous-candle trailing with a minimum step, plus breakeven on a profit threshold with optional offset. One-click market and pending orders apply predefined offsets and SL/TP rules. Additional controls cover close-all, direction-based closes, pending cleanup, and a dashboard for spread, exposure, ...

πŸ‘‰ Read | Calendar | @mql5dev

#MQL5 #MT5 #EA
❀45πŸŽ‰1
ExMachina Prop Dashboard is an MT5 chart indicator focused on real-time compliance tracking for funded-account rules. It updates on every tick and keeps key risk limits visible without relying on delayed web dashboards or window switching.

The tool provides prop-firm presets plus a full custom ruleset, covering daily loss limits, max drawdown variants (static, trailing high-water mark, end-of-day), profit targets, minimum trading days, and calendar deadlines. It reports current P&L in dollars and percent, remaining buffer before breach, and supports configurable day reset time to match broker rollover.

Status logic summarizes progress as ON TRACK, AT RISK, TARGET HIT (days pending), PASSED, or FAILED (limit breach or time expiry). Alerts can trigger at a configurable threshold (default 80%) and on breach via popup, sound, push, or email. It monitors all ...

πŸ‘‰ Read | Calendar | @mql5dev

#MQL5 #MT5 #Indicator
❀35πŸ‘2
Parameter persistence in MQL after terminal restart comes down to four storage options: terminal global variables, chart objects, order comments, and text files. Each has hard limits on type, scope, and lifetime.

Terminal globals are cross-chart but only store double, so packing integers into 64 bits is sometimes required. Chart objects can hold state via hidden properties and survive via templates. Order comments are capped at 23 chars but can encode compact metadata for post-trade analytics and runtime routing.

Text files remain the most flexible: Key=Value params per analyzer, per chart ID, restored on EA restart and only re-run on the next bar. External integration is typically file-based: JSON outbound, Key=Value inbound, plus optional WebRequest notifications to mobile.

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀61✍5
An MT5 mean-reversion EA design based on dynamic price zones and momentum filtering.

Supply/demand boundaries are derived from the highest high and lowest low over the last 48 candles, with entries triggered when price reaches a configurable buffer around these levels. Trend context is taken from a moving average, while RSI is used to reduce false breaks: BUY when price hits the lower zone with RSI below 40; SELL when price hits the upper zone with RSI above 55.

Risk controls include balance-based position sizing using a fixed risk percentage, plus mandatory stop loss and take profit on every order. Break-even and trailing stop logic automate profit protection. Positions can also be closed early when RSI reaches extreme opposite readings.

Operational features include an on-chart dashboard (RSI, spread, risk, magic number), detailed expert logs, zero compil...

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #EA
❀47πŸ‘Œ6😁3⚑2πŸ†2
This article extends a MetaTrader 5 chart-management library with explicit event support for chart objects, subwindows, and indicators. A new enumeration defines chart event types, and registered changes trigger custom events sent to the controlling chart, enabling deterministic event routing in the EA.

A key implementation detail is reliable identification of removed windows/indicators. Indicator objects now store their chart subwindow index, and deleted charts, windows, and indicators are preserved in dedicated lists so handlers can query historical context after removal.

The chart window and chart classes are updated to share these lists via pointers owned by the chart collection, avoiding duplication while enforcing read-only access outside the collection. Indicator handle lifecycle is corrected: handles are retained during use and released in de...

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #Indicator
❀65πŸ‘8⚑5🀯4πŸ‘Œ2
ATR Strength Index implements an RSI-style oscillator where the input series is ATR delta rather than price change. Each bar computes diff between consecutive iATR values, splits it into positive and negative components, and applies Wilder smoothing over RSI_period via PosBuffer and NegBuffer.

An Invert switch flips the diff sign so the oscillator aligns with standard RSI direction conventions. Output is clamped to 0..100 with neutral handling when both smoothed legs are zero.

The indicator draws in a separate window, limits processing via NumberOfBars, and adds adjustable upper/lower horizontal levels with custom colors using OBJ_HLINE.

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL4 #MT4 #AI
❀34πŸ”₯4πŸ†2πŸ‘Œ1
Hidden Smash Day setups are simple in concept but ambiguous on charts. For systematic trading, terms like β€œlower portion of the bar” and β€œconfirmation” must be converted into numeric thresholds to stay deterministic in backtests and live runs.

An MQL5 custom indicator can codify the Larry Williams rules: close location within the bar range, close relative to the prior close, and next-session confirmation (buy: next close above prior high; sell: next close below prior low). Signals can be marked immediately or only after confirmation via an input mode.

Visual output stays minimal: sea green up arrows below buy bars and black down arrows above sell bars. The implementation emphasizes non-repainting logic, strict bar-complete evaluation, and consistent buffer indexing for historical and real-time updates.

πŸ‘‰ Read | Calendar | @mql5dev

#MQL5 #MT5 #Indicator
❀42⚑5πŸ‘€2πŸ‘Œ1
Part 2 extends a news filter beyond blocking entries by managing already-open positions during high-impact windows. The goal is to prevent premature SL/TP hits from spread widening and transient spikes without closing trades or altering strategy statistics.

A controlled layer suspends SL/TP once per news window, stores original levels per ticket, and restores them deterministically when the window ends. Restoration is price-aware: if the market has not crossed stored levels, restore exactly; if crossed, place the nearest broker-valid level in front of price while respecting minimum stop distances.

Implementation requires a per-ticket state container, a suspension flag to prevent repeated modifications, magic-number scoping, and explicit single-symbol behavior. Risk remains during suspension due to lack of hard stops; the window should be short. Persistent s...

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #EA
❀60πŸ‘€6⚑5πŸ‘Œ4πŸ†4