MQL5 Algo Trading
490K subscribers
3.1K photos
3.1K 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
MT5 development is event-driven: indicators/EAs react to terminal callbacks (init, tick, chart changes) rather than running linear code. Scripts can’t capture user events; choose the model based on needed interactivity and trading access.

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #Indicator
❀41✍6πŸ‘Œ4πŸ‘3πŸŽ‰2
A deviation indicator based on price momentum rather than raw price can be used as a computationally light alternative to classic standard deviation. The calculation targets minimal CPU load while keeping the output range broadly comparable to standard deviation values.

As with standard deviation, the method can be applied to inputs beyond price, since it measures dispersion of the chosen series. Interpretation remains similar: higher readings indicate greater variability in momentum, lower readings indicate tighter movement.

Usage is generally aligned with standard deviation-style workflows, including volatility filtering, regime detection, and threshold-based signal gating.

πŸ‘‰ Read | Signals | @mql5dev

#MQL4 #MT4 #Indicator
❀22✍2πŸ‘Œ2
This article extends a Python MetaTrader 5 simulator toward full tester-style isolation by persisting historical ticks and bars locally instead of querying the terminal at runtime.

It tackles the core scaling problem: tick history is huge (millions of records for months), so data is collected in monthly chunks and stored as partitioned Parquet using Polars for efficient IO and lower RAM pressure. It also notes a practical constraint: available tick depth is limited by the broker’s terminal cache.

On top of the storage layer, the simulator mirrors the MetaTrader5 Python API: tick/bar retrieval functions switch between live MT5 and local Parquet based on an IS_TESTER flag, with UTC-aware indexing for time-dependent calls.

Trading state APIs are overloaded to match MT5 semantics (namedtuple returns, symbol/ticket/group filters) for orders, positions...

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀36πŸ‘2πŸŽ‰2πŸ‘Œ2
Larry Williams’ volatility breakout is framed as a momentum trigger: when price expands beyond the prior day’s normal range, it often continues in that direction. The article turns that idea into an objective, testable MT5 process by anchoring entries, stops, and targets to yesterday’s range rather than guesswork.

Rules are minimal and strict: at the day’s open, compute buy/sell β€œgates” as a user-defined fraction of the previous day’s high-low range. Trade only if price reaches a gate; otherwise stand aside. Stops scale with the same range, and take-profit is set via a fixed risk–reward multiple. Only one position is allowed.

Implementation in MQL5 focuses on clean EA structure: CTrade for execution, enums for safe inputs, new-bar detection via iTime, and a struct to cache seven daily levels (range, entries, SL/TP) recalculated once per day for consistent b...

πŸ‘‰ Read | AlgoBook | @mql5dev

#MQL5 #MT5 #EA
❀33πŸ‘Œ3
Heikin-Ashi smoothing remains a practical way to reduce candle noise, but standalone HA signals can fail when isolated strong bars appear inside a broader countertrend move.

A stricter filter is added with EMA50 slope on close as the directional gate, plus EMA20 on high/low as short-term boundaries. Signals are accepted only when HA direction, EMA50 slope, and HA close breaking the EMA20 envelope all agree, with a prior-bar cross check around EMA50 to reduce repeats.

Implementation in MQL5 uses EMA indicator handles, tester-safe HA calculation fallback, strict object naming, and timestamp de-duplication. Cleanup releases handles and removes prefixed objects to avoid chart clutter and resource leaks.

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #Strategy
❀30πŸ‘Œ5🀣4πŸŽ‰1
This article breaks down a practical way to reduce bad trades: treat higher timeframes (MN/W1/D1) as the source of direction, and view lower-timeframe swings as noise. The core workflow is marking key reaction zones (prior highs/lows), then confirming bias with price action shifts like a purge plus an engulfing/structure change.

The β€œTrend King” MQL5 EA automates that discipline by only taking entries aligned with the detected trend. It combines SMA/EMA trend filters, purge + engulfing signal rules, volume confirmation, and a trailing stop to protect gains.

Key engineering details include strict parameterization (RR targets, lookback windows, multi-timeframe confirmation), 1% risk management, OnInit validation for safe configuration, and new-candle gating to avoid redundant intrabar decisions.

πŸ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #EA
❀31πŸ‘Œ4
A Python + MetaTrader 5 study compared real EURGBP to a synthetic cross (EURUSD/GBPUSD) over 12,593 M5 bars from 2025-01-14 to 2025-03-15.

Mean imbalance: -0.000026, stdev: 0.000070. Distribution was strongly non-normal (skew -9.33, kurtosis 160.69), with lag-1 autocorrelation at 0.5985, indicating persistence and occasional large negative outliers.

Session breakdown showed Europe had the lowest spread (~0.000005) and lowest imbalance volatility (0.000030). A mean-reversion setup using EMA and a 2-sigma threshold (0.000126) produced 24 European trades with net +0.006073, while Asia and US were negative under higher spread costs.

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀24πŸ‘9🀯3
Part 11 builds a MetaTrader 5 correlation matrix dashboard to quantify cross-asset relationships for portfolio design, hedging, and multi-symbol strategies. It supports Pearson (linear), Spearman (rank-based), and Kendall (order agreement), all computed on price deltas over a selectable timeframe and bar count.

Two visual modes are implemented: a standard grid using configurable thresholds plus p-value β€œstars” for statistical confidence, and a heatmap using color interpolation to reveal subtle correlation differences.

The MQL5 design emphasizes extensibility: symbol-list parsing with Market Watch validation, matrices for correlations and p-values, reusable CDF-based p-value functions, and event-driven UI controls for timeframe and mode switching with automatic refresh on new data.

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #algorithm
❀28⚑4πŸ‘Œ1
Bollinger Bands often assume mean reversion, but performance shifts across regimes. A practical filter is RSI: take longs only on lower-band breaks with RSI oversold, and shorts only on upper-band breaks with RSI overbought.

A fixed EURUSD D1 backtest (Jan 2023–Jan 2026) with tick modeling and randomized execution delay produced 14 trades. Win rate reached 64% with 4.37 expected payoff, but trade frequency was too low for systematic use.

Rule tweaks to boost activity raised trades to 29 but reduced net profit and increased drawdowns, indicating added noise.

Data was exported from MQL5 to CSV, then modeled in Python with time-series cross-validation. ARDRegression scored best and was exported to ONNX for EA inference, yet the equity curve worsened versus rule-based baselines.

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #Indicator
❀31✍7
Chimera extends classic state space models by modeling dependencies along both time and feature axes, using discretization steps to tune long-term vs seasonal behavior and coarse vs detailed cross-variable structure. Causality limits feature-wise information flow, so the design processes neighboring features in two directions and can generate parameters either as constants or from context projections.

The MQL5/OpenCL implementation builds a 2D-SSM neuron with explicit forward/backward passes: create time/feature projections, generate context-dependent parameters, run an OpenCL kernel for state/output updates, then backpropagate by swapping buffers to preserve states and correctly accumulate gradients through all branches and activations.

A Chimera module stacks two parallel 2D-SSMs at different discretizations, aligns their outputs via a convolutional di...

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀36πŸ”₯1πŸ‘¨β€πŸ’»1
Educational-only material; not trading advice. EURUSD backtests under the stated constraints were unprofitable.

Method: the high/low of the first 4H candle is captured using New York local time. After that 4H bar closes, the system waits for a 5-minute close outside the range, then a subsequent 5-minute close back inside. Close above high then back inside triggers a sell signal; close below low then back inside triggers a buy signal.

A time filter invalidates signals if price remains above the high or below the low for more than 75 minutes, reducing entries after extended moves. Correct server time handling is critical: broker GMT offsets and DST switch dates must be configured accurately or the New York 4H window shifts and invalidates results.

Inputs: ServerGMTOffsetWinter, ServerGMTOffsetSummer, ServerSwitchToSummerMonth/Day, ServerSwitchToWinterMo...

πŸ‘‰ Read | Quotes | @mql5dev

#MQL4 #MT4 #Strategy
❀29✍3πŸ‘2πŸ‘Œ2
PropGuard MT5 is a chart-window indicator focused on prop-style risk constraints: Daily Loss Limit and Overall Max Drawdown. It converts configured limits into a live price boundary (β€œDead-Line”) derived from current equity, open positions on the active symbol, and tick value/tick size.

The indicator draws a single effective Dead-Line based on the stricter of the daily or overall limit, with optional separate daily and overall lines. A dashboard panel reports balance/equity, allowed loss, minimum equity levels, net long/short lots, active rule, and remaining buffer in currency and points with a configurable warning threshold.

Trailing and fixed drawdown modes are supported. Trailing uses daily/overall peak equity; non-trailing uses start-of-day balance (approximation in v1.00) and a manual start-capital reference.

Safety states include hiding lines ...

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #Indicator
❀30⚑4πŸ‘3πŸ‘Œ2
Educational use only; not trading advice. EURUSD backtests under the stated conditions were unprofitable.

Strategy logic uses New York local time. The first 4H candle defines the initial high/low range. After that candle closes, the system waits for a 5-minute close outside the range, then a 5-minute close back inside. Close above high then back inside triggers a sell signal. Close below low then back inside triggers a buy signal.

A time filter invalidates signals if price remains above the high or below the low for more than 75 minutes, intended to avoid late entries after an extended move.

Correct broker time configuration is required. Parameters include winter/summer server GMT offsets, server switch dates for summer and winter time, and lot size. A single DST or offset mismatch can shift the entire session alignment.

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #Strategy
❀26πŸ‘Œ3⚑1
Wick Rejection Scanner Dashboard is an MT5 indicator that scans multiple symbols and timeframes for upper/lower wick rejection candles and shows results in an on-chart dashboard. It targets price-action workflows that need watchlist coverage without opening many charts. The module is a scanner and visualizer only and does not execute trades.

Signals are generated from configurable rejection rules: dominant wick percentage, minimum candle range, minimum body size, opposite-wick cap, optional ATR volatility gating, and optional trend-context scoring to reduce weak in-range setups.

Core functions include Market Watch or custom symbol lists, timeframe selection with optional M15/H4 passes, ranked sorting (recent, wick %, strength), age display, and click-to-switch chart navigation. Optional chart markers and labels are available with caps for performance...

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #Indicator
❀30✍4πŸ‘2πŸ‘Œ2😁1πŸ€”1
The article extends a DoEasy/MQL5 UI concept: each β€œanimation frame” draws on a form while preserving the pixels underneath, so moving, updating, or deleting visuals cleanly restores the original background.

A new base CFrame class centralizes shared state (IDs, coordinates, anchors, last offsets) and embeds the pixel-copy/restore logic previously kept inside the form. Two derived frames specialize rendering: CFrameText for text and CFrameQuad for shapes built on CCanvas primitives.

The rectangle frame adds per-primitive bounding-box calculations (dot, vertical/horizontal segments, free lines, polylines) to save only the affected area. Support code is improved with frame/figure enums, array min/max helpers that avoid β€œ-1 means error” ambiguity, and anchor-based methods to compute saved-rectangle offsets for both text and images.

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀58πŸ‘7πŸ‘€4πŸ’―3⚑2πŸ‘Œ2🀩1
News Spread Risk Dashboard is a lightweight chart-overlay indicator that monitors the live Ask–Bid difference and flags conditions where spread expansion can undermine entries, exits, and risk controls. It targets periods commonly associated with widening spreads: high-impact news, rollover, session transitions, and low-liquidity opens.

The panel displays Current, Min/Max/Avg spread over a rolling window, plus a status line showing Stable or RISK with the triggering reason. Background color changes when warning logic is met to keep the signal visible without clutter.

Two trigger modes are supported. Relative spike detection warns when Current β‰₯ Avg Γ— multiplier, adapting to each symbol’s typical spread. Absolute thresholds warn when Current β‰₯ fixed limit, including per-instrument lists (for example, EURUSD:3.0, XAUUSD:30.0).

Display can be Smart A...

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #Indicator
❀48⚑5πŸ‘Œ2πŸ€”1
Playground EA is a five-version MQL5 Expert Advisor set (v1.00–v1.04) built for testing Fair Value Gap encroachment and, in later builds, liquidity targeting. The code is explicitly experimental, not optimized, and intended for learning and controlled testing.

All versions share the same core entry rule: buy on a candle close above the FVG encroachment point and sell on a close below. Position management is primarily dollar-based profit and loss thresholds, with optional filters such as minimum gap size and trend alignment.

Version changes are incremental. v1.00 combined encroachment and liquidity scalping but had functional issues. v1.01 removed liquidity features and stabilized execution. v1.02 added Silver Bullet time windows and Draw On Liquidity targets, but had configuration and timing problems. v1.03 refactored for parallel mode execution and corrected se...

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #EA
❀24πŸ‘Œ4πŸŽ‰3
Complex indicators with 70+ buffers and 30+ plots often fail on maintainability due to manual SetIndexBuffer numbering. A small change in draw order, such as moving a filling background behind a candle plot, can force renumbering dozens of bindings and recalculating plot-to-buffer offsets, including extra color buffers.

A wrapper class named CPlotManager is used to automate plot hierarchy and buffer allocation. Plots are added in the required draw order, while the class computes indices, binds buffers, and applies styling without large property blocks for colors and widths.

Typical usage keeps the indicator properties limited to total plot and buffer counts, includes the helper file, then creates the manager in OnInit() and registers plots sequentially. Z-order changes become a simple reordering of add calls.

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #Indicator
❀28✍4πŸ‘Œ3πŸ‘1
Session Daylight Gradient is an ambient session-awareness indicator for MetaTrader 5 that replaces large session boxes with a low-noise background gradient. The color progression reflects typical market behavior across Pacific, Asia, London, the London/NY overlap, and the NY fade into Pacific, keeping price action readable via adjustable opacity and smoothing.

Optional session event markers add compact labels and separators for session opens/closes and overlap boundaries. Optional β€œsunrays” highlight scheduled timestamps from a simple list to flag news windows without switching to a calendar.

Timezone handling supports UTC, broker/server time, or PC local time, with a manual DST hour shift for alignment corrections. Performance is managed by drawing objects only for the visible chart range plus a buffer, with guidance to reduce visual load on very lo...

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #Indicator
❀27πŸ‘Œ4✍3πŸ†2πŸ‘€2
Probability theory is presented as a practical framework for trading that replaces intuition with measurable risk: expected value, event likelihoods, percentiles, and clearly defined acceptance of uncertainty.

The article models market behavior through event spaces, distinguishing non-overlapping vs overlapping states, and shows how probabilities must sum to 1 in an exhaustive partition. For continuous outcomes, it switches to random variables and probability density, where event probabilities come from integrating regions.

Random walk is used as a baseline: with symmetric stops and no costs, expectancy trends to zero; with spreads/fees, negative. That baseline still helps compute risk metrics like lifetime and path-dependent event odds.

It then builds toward probability trees via the total probability formula, treating β€œhypotheses” as nested even...

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀57πŸ‘Œ8✍6πŸ‘Ύ6
ASZ (Adaptive Structure ZigZag) is an open-source market structure analyzer built as an update to the classic ZigZag/fractal approach. It targets common issues in fixed-threshold ZigZags that lag during fast moves and generate excess noise in slow markets.

The logic relies on a hybrid threshold driven by ATR. In higher volatility, the swing-detection threshold expands to reduce noise. In lower volatility ranges, it contracts to capture smaller structural changes. Swing validation scans 3–14 bars to the left and confirms using a fixed number of right-side bars.

ASZ is not a signal indicator and does not produce buy/sell entries. It is designed to mark highs, lows, and break-of-structure with deterministic behavior. Once confirmed, swing points do not repaint. Performance is optimized with caching, and a state machine enforces strict high/low alternation to ...

πŸ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #Indicator
❀47πŸ‘6πŸ‘¨β€πŸ’»4