MQL5 Algo Trading
581K subscribers
4.71K photos
7 videos
4.71K 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
FibStructureEngine is an MT5 indicator that merges pivot-based market structure with automated Fibonacci retracement and extension levels. Swing highs/lows are confirmed via a configurable SwingLength, with an optional 14-period ATR filter to suppress minor moves.

Each structural break is classified as BOS (trend continuation) or CHoCH (potential reversal), with HH/HL/LH/LL labels kept on-chart. After a break, a Fibonacci grid is anchored to the latest significant swing pair, with selectable 0.382/0.500/0.618/0.786 levels, a 0.500–0.786 zone box, and -0.500/-0.618 extensions.

Signals use a weighted confirmation score: structural bias, interaction with the retracement zone, and optional engulfing patterns. A cooldown limits repeated triggers. Alerts are generated on bar close with symbol, direction, entry, score, and ATR-based SL/TP (1.5x/2.5x).

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #Indicator
❀41⚑5
ASQ News Filter v1.2 is a free, open-source MQL5 library that blocks EA trading around economic releases. It pulls events from the MQL5 Calendar API every 5 minutes, including actual/forecast/previous values, then filters them by symbol currency (base/quote) while handling common broker suffixes.

Impact filtering supports High only, High+Medium, or All, with configurable pre/post windows from 5 to 120 minutes. Special cooldowns extend post-news pauses for NFP (60 minutes) and FOMC (90 minutes), both adjustable. Built-in schedules cover nine central banks plus NFP, and event titles are classified into types such as CPI, GDP, PMI, retail, and employment.

The package includes a demo EA dashboard with a four-level intensity gauge, trading allowed/blocked status, and the next three events with countdowns. Integration is a single include plus per-tick Update(), ...

πŸ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #EA
❀32⚑3πŸ‘€3
An Expert Advisor combines RSI-driven entries with a grid position-management layer. Initial trades trigger on RSI thresholds, then additional orders are placed at defined grid intervals when price moves against the first position.

A built-in overlap routine targets drawdown reduction by closing selected combinations of winning and losing trades once predefined criteria are satisfied. Risk controls include fixed, balance-based, or risk-based lot sizing, grid step and multiplier settings, plus trailing stop and breakeven logic.

Operational tools include a manual trading panel with Buy/Sell actions and a time filter to restrict activity to specific sessions.

Account constraints remain significant: hedging mode is required, netting is not supported. Due to grid exposure in strong trends, demo validation and conservative risk limits are recommended.

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #EA
❀28πŸ‘Œ2
In MetaTrader 5 build 5800, we have started enhancing the main trading dialog. It now features a more modern design, an integrated Depth of Market, and more convenient switching between operation types. In future updates, we will further enhance stop level placement and introduce risk control tools.

We have also improved integration with the OpenBLAS linear algebra library by adding new methods for L1 trend filtering and refining the update mechanism for required files.

MetaEditor now also offers a more convenient way to work with CSV files. The editor automatically displays them in a tabular format, allowing you to filter data, sort by columns, and delete rows via the context menu.

In addition, we have implemented stability improvements for the Strategy Tester and the web version of the platform.

Read more...
❀23πŸ”₯5πŸ‘Œ3
This article completes a chaotic optimization implementation and shifts focus from theory to test-function validation. The solver explores the search space with deterministic chaos (logistic, sinusoidal, tent maps), then transitions into refinement with a weighted gradient step and a final local search that progressively narrows its scope.

Key implementation details center on robustness and constraint handling. Mutations are applied safely by selecting a bounded subset of coordinates, mixing full random resets, moves toward the global best, and chaos-driven perturbations, while resetting velocity to avoid carrying stale momentum. Constraints are enforced with per-coordinate violation measures, directional gradients, and a quadratic penalty term whose weight (sigma) adapts to the population’s feasible-solution ratio.

To reduce premature convergence,...

πŸ‘‰ Read | AlgoBook | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀44πŸ‘5πŸŽ‰3✍2πŸ‘Œ2🀑1
A compact utility dashboard for MT5 charts that aggregates open and closed trade data and renders account status directly on the chart. It focuses on fast visibility of risk, performance, and session activity without relying on separate terminal panels.

The panel is designed to be movable and collapsible within the chart window. Layout and appearance are configurable via Panel_X and Panel_Y offsets, plus optional background and text colors (Panel_BG, Text_Color) for readability.

Displayed metrics include Account Balance, Equity, Total Trades Today, current open Positions, Floating Profit/Loss, and the count of Today’s Closed Trades. The result is an at-a-glance control surface for monitoring exposure and execution outcomes during active trading.

πŸ‘‰ Read | AlgoBook | @mql5dev

#MQL5 #MT5 #Indicator
❀39πŸ‘Œ1
A lightweight trading control panel reduces routine order management on MT4 and MT5 using a single compiled file. The UI is draggable, can be enabled per section via inputs, and persists its position between sessions.

Core functions include one-click market buy/sell, symbol-level close all, and separate close for buys or sells. Risk handling supports fixed lots or a balance-percentage mode, with an optional trade comment field.

Trade management tools cover breakeven for all positions, batch SL/TP modification, partial close by custom lot size, and chart-click pending order placement. Pending orders can also be removed with one click by direction.

Validated across forex, metals, synthetic indices, and crypto pairs. Custom variants can be commissioned via the MQL5 Freelance marketplace.

πŸ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #EA
❀28πŸ‘Œ4
BEC Trade Manager is an EA focused on active position control for the current symbol, with one-click actions for breakeven, trailing, partial close, stop-loss removal, profit-side and loss-side liquidation, plus quick scalp entries. Chart overlays include equity, floating P/L, daily profit, SL labels, and a basket breakeven preview.

Core logic covers basket-level account breakeven with a configurable lock-profit offset, classic price-distance trailing, per-trade breakeven lock, and step-based position trailing from the current SL anchor. Execution tools include close-profit only, close-loss only, 50% close with breakeven protection, cancel stop losses, and close-all with pending-order cleanup. Filters support order type, magic number, and comment.

Operational note: this is management automation, not a signal system. Outcomes depend on spread, execution, brok...

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #EA
❀34πŸ‘5πŸ‘Œ3πŸ‘€3⚑1✍1
Matrix arbitrage reframes FX as a consistency problem across 8 majors. The EA builds an 8x8 currency relationship matrix and derives each pair’s fair value from all available cross-rates, then trades when the live quote deviates beyond a configurable threshold.

Implementation details focus on performance and robustness: the matrix is stored in a 1D array, refined iteratively, and blends direct quotes with implied cross rates using tested weights to balance stability vs sensitivity.

Signals are simple: undervaluation triggers buys, overvaluation triggers sells. Risk is normalized per symbol via pip value, volatility, and broker lot limits, plus an optional global profit target that closes all positions and halts trading. A real-time imbalance matrix on-chart helps validate opportunities quickly.

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀29πŸ‘2πŸ‘Œ2πŸŽ‰1
Tree-based classifiers often output overconfident probabilities, especially in noisy financial labels, so accuracy can look acceptable while probability estimates are systematically too extreme. That miscalibration feeds directly into bet sizing and Kelly-style sizing, creating oversized positions, deeper drawdowns, and weaker geometric growth.

Calibration is evaluated with reliability diagrams plus Brier score (overall usefulness), ECE (average gap), and MCE (worst-case tail risk), with bootstrap confidence bands to reflect limited independent samples.

Two practical calibrators are compared: isotonic regression (non-parametric, rank-preserving, best with enough data) and Platt scaling (sigmoid, steadier with small samples but less flexible).

The key engineering constraint is avoiding temporal leakage. Calibration is fit on out-of-fold predictions p...

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #AITrading
❀36
This MT5 approach rotates risk capital by time of day instead of treating all hours equally. It assigns smaller budgets to Asia, more to London breakouts, and the largest share to New York volatility, focusing each session on its historically strongest symbols and avoiding off-hours overtrading.

The core is a session-aware allocation engine separated from entry logic. A daily risk cap (percent of balance) is split per session (equal or manual). Each trade sizes lots from remaining session budget using stop-loss distance and pip value, enforcing daily and session limits.

Execution uses a volatility-confirmed breakout model. The EA tracks prior session highs/lows, validates breakouts with ATR β€œvolatility stops,” and switches between momentum trades and fades. It resets budgets daily, preserves winning positions across sessions, and closes only losers.

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀36πŸ†6πŸ€”4πŸ‘2
Fractional differentiation solves a core preprocessing trade-off in financial ML: returns enforce stationarity but destroy price-level memory, while raw prices preserve context but break stationarity. By differencing with a real-valued d between 0 and 1, the series can pass stationarity tests while retaining more of the original structure needed for mean-reversion and trend models.

The method uses binomial-series weights generated efficiently via a recurrence. Two implementations matter: expanding windows can introduce artificial drift as the lookback grows; fixed-width fractional differentiation (FFD) truncates weights by a threshold, applies a consistent window, and avoids drift.

The practical workflow searches for the smallest d that achieves stationarity using the ADF test, typically via binary search, while monitoring correlation to quantify ret...

πŸ‘‰ Read | AlgoBook | @mql5dev

#MQL5 #MT5 #Strategy
❀40πŸ‘3πŸ†3πŸ€”2πŸ‘Œ2✍1
XANDER Grid XAUUSD is a bidirectional grid EA for gold trading on MetaTrader 5. It places buy orders after a bullish candle and sell orders after a bearish candle. New grid entries are added only after price moves a configured distance from the last entry, combining candle direction with spacing to limit overtrading in range conditions.

It runs two independent grids (buy and sell). When multiple positions exist on one side, it calculates a weighted average entry and applies a shared take profit to the basket. Closing options include an average TP for the group or partial reduction of the worst position to manage exposure.

Risk controls include a daily profit target that flattens all positions and a max floating drawdown filter that pauses new entries. Configuration covers TP, grid step, basket profit threshold, starting and max lot caps, slippage, and magic n...

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #EA
❀41✍5πŸ‘Œ2πŸ‘1πŸŽ‰1
ASQ Session Manager v1.2 is a free, open-source MQL5 session library aimed at adding session awareness to EAs. It detects Sydney, Tokyo, London, and New York with automatic broker GMT offset, tracks session phases, and resolves overlaps by priority.

Core logic includes kill zone identification (London/NY opens, Asian, London close, overlap), Asian range breakout detection for 00:00–06:00 GMT with false-break filtering and 1.5x expansion targets, plus ATR-relative volatility scoring versus a 20-day baseline. Safety gates cover weekends, late Friday, early Monday, and NFP first-Friday blocking.

Integration is a small include-based API (Initialize/Update/IsTradingAllowed/HasSignal). A demo indicator visualizes sessions, kill zones, Asian range state, volatility, countdowns, and entry/SL/TP for three built-in signal types. Files: .mqh library and .mq5...

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀22πŸ‘5πŸ‘Œ3πŸ‘€1
QuantumAlgo adds execution and risk controls aimed at reducing manual inputs and sizing errors.

Automatic position sizing calculates volume from stop loss distance and a predefined risk percentage, with real-time display of total capital at risk. Twin order splitting sends two 50/50 orders, supporting a 1:1 RRR target on the first and an open-ended runner on the second. Margin metrics show free margin and required margin before order placement.

Strategy filters and alerts include Bill Williams Wise Man 1–3 signals and Ichimoku logic. A symmetrical pair filter suppresses correlated-pair alerts when exposure already exists. Additional filters use Alligator, Kijunsen, or Senkou Span A, plus line/MA/Ichimoku cross notifications.

Trade handling includes global break-even, optional trailing/exit management, session range boxes, an Ichimoku market scanner, bulk c...

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #EA
❀38πŸ‘Œ4πŸ†1
The EA maintains a daily session schedule by calculating range start, range end, and trading close times, then resetting state for the next cycle.

During the range window it aggregates minute highs and lows, tracks the session maximum and minimum, and updates a chart rectangle to reflect the current consolidation boundaries.

After the range window closes, it evaluates the close of the latest candle (not necessarily aligned with the range end time) against those boundaries. On a confirmed break, it sends a buy or sell order with take-profit set to the measured range size and stop-loss placed at the opposite boundary.

Example setup: EURUSD, 2026.01.01–2026.03.03; Range Start 05:00, Range End 11:00, Trading End 22:00.

πŸ‘‰ Read | AlgoBook | @mql5dev

#MQL5 #MT5 #EA
❀26πŸ‘Œ4
GoertzelBrain tackles the main weakness of classic cycle detection: knowing a dominant period and amplitude still doesn’t answer β€œlong or short” in non-stationary markets. It keeps Goertzel’s efficient single-frequency DFT, but adds context with a self-training neural ensemble.

Per bar, it builds a 7-feature vector from spectrum state (dominant period, amplitude, normalized confidence), spectral dynamics (period/amplitude slopes), plus price slope and volatility. Ten small MLPs (7-12-1) train online via single-sample SGD and are averaged to reduce instability.

The output becomes a directional filter: long only when the ensemble is above zero and rising; short when below zero and falling. A hidden buffer is exposed via iCustom() for EA integration, with careful heap allocation to avoid GoertzelCycle pointer lifetime bugs.

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #AITrading
❀25πŸ‘Œ6
Repeated high/low scans inside trailing stops turn many MT5 EAs into O(N) workloads, creating latency and exit drift on VPS deployments. The article switches to a data-first design: deterministic, cleaned history plus constant-time extrema queries.

A Sparse Table precomputes min/max over power-of-two ranges, built once at init (or refresh) and queried in O(1) via two overlapping blocks. This replaces per-bar lookback loops with indexed range lookups suited to frequent trailing updates.

For reproducible inputs, a Python Polars pipeline cleans broker data (gap handling, interpolation, Hampel outlier filtering, log-return validation) and writes to SQLite. MQL5 reads timestamped, targeted SELECT results to build the table and feed trailing logic without terminal-history inconsistencies.

Trailing decisions add an excursion validator: stops update only wh...

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀26⚑2πŸ†2
Fractal-based Algorithm (FBA, 2017) tackles continuous optimization by building a self-similar, hierarchical partition of the search space. Instead of sampling uniformly, it repeatedly splits regions and allocates work where good solutions cluster, balancing global exploration with local refinement.

The workflow: generate an initial population, keep the best fraction of points, estimate each subspace’s β€œpotential” by counting how many strong points fall inside, then mark the top-ranked regions and subdivide them. A small share of mutated points injects randomness to reduce stagnation.

The MT5 implementation (C_AO_FBA) models subspaces with bounds, hierarchy level, parent links, and a normalized rank. New populations are generated proportionally to subspace ranks, with safeguards for high dimensions and a hard cap on subspace count to control resources.

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #algorithm
❀42
A common rule-based approach in indicator-driven trading uses arrow signals for entries and a central reference line for exits on an existing position.

An arrow is treated as a directional trigger to open a long or short trade. The middle line is then used as the close condition, typically when price crosses it or when the indicator state returns to neutral.

This setup separates entry logic from exit logic and can reduce churn from frequent signal flips. Practical use still requires clear definitions for confirmation, stop-loss placement, and behavior during ranging markets, since both arrows and midline crosses can lag or repaint depending on implementation.

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #Strategy
❀28πŸ‘Œ5✍3πŸ‘2