MQL5 Algo Trading
489K subscribers
3.09K 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
Overbought/oversold indicators are commonly used to estimate where price may reverse.

In the classic Williams %R (WPR), readings around -20 are typically treated as overbought. When price pushes into this zone, traders often watch for conditions that could support a downward reversal and a potential sell setup.

Readings around -70 are typically treated as oversold. When price reaches this area, some traders look for signs of a reversal upward and a potential buy setup.

These levels are context-dependent and work best with risk controls and confirmation, since no indicator can reliably predict outcomes.

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #Indicator
❀27πŸ‘Œ3
Session Range Boxes draws filled high/low range boxes for the Asian, London, and New York Forex sessions directly on the chart. For each day in the lookback, it scans M1 bars inside each session window and marks the exact high and low, with an optional dotted midpoint and per-box range label. All sessions can be shown at once to compare range size and overlap.

A stats panel reports average range in pips per session across the configured DaysBack. Optional breakout alerts trigger when price exits today’s session box, once per session per day, resetting at midnight server time.

Key settings include session start/end times (server time), DaysBack, box transparency, colors, and alert delivery. M1 history must be available; missing data can require loading more history and re-attaching.

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #Indicator
❀28πŸ‘Œ2
Swing Extremes and Pullback logic was converted into an automated, rule-driven EA built on multi-timeframe structure (HTF bias + LTF execution). Swing highs/lows are detected via SwingBars scanning, stored as structured objects, and updated only on new bars for efficiency.

Trade triggers are defined as structural displacement: sell when bid is above both last LTF swing high and low; buy when price drops below the last LTF swing low. Take-profit inherits the opposite swing level, with risk-based fallbacks and broker-compliant sizing. One-trade-per-swing is enforced via timestamp/price guards.

Runtime flow uses OnTick bar-gating, structure-break resets, optional HTF filtering, and chart visualization that renders swings, bias labels, and key price levels. Backtest reference: H1, 01 Dec 2025–01 Jan 2026, defaults mentioned.

πŸ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀36πŸ‘Œ4
This article upgrades a liquidity-zone strategy that can signal both directions by adding a simple directional anchor: an EMA(50) trend filter. The goal is to treat liquidity zones as trend-continuation pullbacks, not reversal points, reducing low-probability countertrend trades.

Core rule set: place buy limits only when a demand zone forms above the EMA; place sell limits only when a supply zone forms below it. Profit targets are focused on recent swing highs/lows aligned with market structure.

On the MQL5 side, the filter is implemented as a dedicated, stateful module (TrendFilter.mqh) that owns the iMA handle, reads closed-bar values (shift 1), exposes β€œbuy allowed/sell allowed” permissions, initializes in OnInit, and releases resources in OnDeinit. This keeps OnTick clean, reusable, and safer during testing.

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #Strategy
❀39πŸ†3
Smash Day reversals tend to generate noisy signals when traded without timing, context, and validity rules. A rule-based EA converts the pattern into measurable conditions that can be automated and backtested across symbols and timeframes.

Signal definition: Buy when a bar closes below the lows of N prior bars, Sell when a bar closes above the highs of N prior bars. Outside bars are excluded. The Smash bar is only a setup, not an entry.

Execution: entries trigger on a break of the Smash level or on a confirmed close beyond it. Each setup expires after a fixed number of bars. Optional filters include Supertrend trend alignment and day-of-week gating.

Risk: SL at the Smash bar extreme, TP via fixed R:R, with manual lots or percent-risk sizing. The EA enforces one position at a time for test clarity.

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #EA
❀58πŸ”₯4πŸ‘Œ4✍2πŸ€”2πŸŽ‰2πŸ†1
ICE Pro memakai arsitektur tiga lapis untuk validasi sinyal. Layer Detection memadukan rasio volume dan body candle terhadap ATR untuk menangkap impuls awal. Layer Confirmation menambahkan adaptive trend filter berbasis slope MA serta volatility guard agar sistem tidak aktif saat pasar low activity atau spread melebar. Layer Execution menjalankan tiga skenario entry: breakout, pullback, dan velocity untuk mengurangi slippage tanpa kehilangan momentum.

Hasil refactor menambahkan ATR auto-point calibration agar logika tetap konsisten di XAUUSD, forex, dan indeks tanpa penyesuaian desimal manual. Modul momentum velocity memungkinkan entry lebih cepat saat percepatan harga terdeteksi.

Karakter trading cenderung aggressive impulse follower dengan timeframe M15–H1, lot adaptif berbasis ATR, serta filter sesi yang menghindari Asia dan jam rollover. Parameter utama...

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #EA
❀37🀨6πŸ‘2😁2πŸ‘Œ2
Breakeven in MT5 is a practical stop-management technique: once price moves into profit by a defined threshold, Stop Loss is shifted to the entry price (optionally plus extra points) to avoid turning a winning move into a full loss.

The article outlines three activation models: fixed points, ATR-based distance that adapts to volatility, and Risk-Reward triggers that protect trades at milestones like 1:1.

On the implementation side, it builds a reusable CBreakEvenBase: a ticket registry with price_to_beat and breakeven_price, automatic vs manual modes, and OnTradeTransaction integration to track entries/exits and call CTrade::PositionModify safely.

The first derived class, CBreakEvenSimple, implements the fixed-points variant with two parameters (trigger distance and extra offset) using MqlParam-based configuration for extensibility.

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #Strategy
❀33πŸ‘2πŸ‘Œ2
MetaTrader 5 build 5660 improves operations with proxy servers. We have enhanced HTTP and SOCKS5 protocol support to reduce connection errors. The outdated SOCKS4 protocol is no longer supported.

We have also revised operations with the OpenBLAS linear algebra library. Its implementation is now delivered as a separate file: openblas.dll.

β€’ The size of the trading terminal and tester executables has been reduced, helping you save bandwidth during platform updates. Since OpenBLAS is updated far less frequently, you will not need to download it each time.
β€’ If multiple platform instances are installed on a computer, they will all use a single shared library file, saving disk space.
β€’ If OpenBLAS functionality is not used, the library is not loaded into memory, reducing resource consumption.

Discuss the update...
❀79πŸ‘17🀑5πŸ‘4πŸ‘Œ4πŸ‘¨β€πŸ’»2
Close_Orders is a universal trade-management routine for MetaTrader 5 that consolidates 14 common tasks into a single call. It supports closing open positions and deleting pending orders with filtering by direction, profitability, and magic number.

Position handling includes: all positions, only profitable, only losing, BUY only, SELL only, BUY profitable, BUY losing, SELL profitable, and SELL losing. Pending order handling includes: all pending, Buy Stop only, Buy Limit only, Sell Stop only, and Sell Limit only.

Key parameters are p_o ("Position" or "Order"), type_po (filter mode), and magicNumber (0 applies to all). Implementation notes include deviation=5 for price tolerance, reverse iteration for safe removal, and local variables for isolated queries. Suitable for Expert Advisors, scripts, and indicators.

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #EA
❀33πŸ”₯2
A cyclical life-development model is being circulated as a numeric matrix (3, 7, 39, 49), positioned as a synthesized framework combining psychological and sociological views, with esoteric references. It is presented as conceptual rather than scientific.

The 3-year unit is described as a repeating learning loop: initial exposure, friction and correction, then integration and stable competence. The 7-year unit is framed as an identity shift that restructures priorities and values, not just skills.

Composite periods include 49 years as seven consecutive 7-year phases (from early dependency through social integration, crisis, responsibility, and meaning), and 39 years as 13 completed 3-year cycles, mapped to peak material/social consolidation with risk of stagnation without new goals.

The model treats crises as boundary conditions between cycles and ...

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #Strategy
❀28πŸ‘Œ2πŸ”₯1
Swing Extremes and Pullback is an MT5 indicator that treats reversals as measurable overextension, not countertrend guessing. It tracks the latest lower-timeframe swing high/low to form a structural range, then flags price displacements beyond those bounds as mean-reversion candidates.

Signals are filtered by higher-timeframe structure (bullish/bearish/neutral) and gated by an ATR-based distance, so only volatility-adjusted extremes qualify. Code design uses SwingPoint structs, structure-state enums, and β€œfire once per swing” tracking to avoid duplicate alerts, with efficient recalculation only on new LTF bars.

Chart output combines arrow buffers, swing markers, key levels, and bias/condition labels, supporting practical entries, invalidation-based stops beyond swing extremes, and targets back into prior structure.

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #Indicator
❀23⚑1
CSV trade logs are often reviewed as static tables, which makes it hard to assess balance progression, drawdowns, and per-trade impact inside MetaTrader 5. Strategy Tester curves do not represent real account history, especially with manual trades.

A practical approach is an MQL5 indicator that reads a CSV from MQL5\Files, extracts the Profit($) column, and builds a cumulative balance curve in a separate indicator window. The subwindow auto-scales to min/max values, draws axes, and optionally prints per-trade P/L labels.

Implementation focuses on separating concerns: load and parse data in a dedicated function called from OnInit and OnTimer, while OnCalculate only redraws when the total trade count changes. This reduces file I/O per tick and avoids unnecessary object updates.

πŸ‘‰ Read | AlgoBook | @mql5dev

#MQL5 #MT5 #Indicator
❀35πŸ‘Œ6⚑1
MASTER-WINNERFX-Asim is an automated MT5 Expert Advisor built for trend-based grid execution with dynamic money management. Signals are gated by an EMA trend filter with RSI momentum confirmation, with the first entry placed only when both conditions align.

If price moves against the initial trade, the system advances a controlled grid using a conservative multiplier. Position sizing follows a LotPer1000 balance model with configurable minimum and maximum lot caps, plus floating loss protection.

Open trades are managed as a basket and closed automatically on TargetProfit or a MaxRisk drawdown threshold. Operational controls include an optional UTC news-hour pause, a market-close filter to reduce rollover exposure, and Magic Number isolation. No external DLLs are used; only standard EMA and RSI indicators are required.

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #EA
❀38πŸ‘2πŸ‘Œ1
Williams %R (WPR) can be used as a momentum filter across multiple timeframes to align entries with broader trend conditions. Monitoring the same indicator on several charts may reduce conflicting signals and improve trade selection, especially in ranging markets where single-timeframe triggers often fail.

One straightforward ruleset is full alignment: open long positions only when WPR conditions and multi-timeframe monitors indicate BUY on every tracked timeframe, and open short positions only when all are in SELL. Partial agreement is treated as a no-trade state until alignment returns.

This approach prioritizes consistency over frequency and shifts most decisions to timeframe selection, signal thresholds, and how BUY/SELL states are defined for WPR.

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #Indicator
❀33πŸ‘Œ1
Profit_and_Loss_Positions is a utility module for calculating aggregate P/L across open positions with optional filtering by position side and Magic Number. Intended for integration into MT5 codebases where consistent P/L aggregation is required.

Core API: Profit_Position(string p_l, string type_pl, long magicNumber). Parameter p_l selects calculation mode ("Profit" or "Loss"). Parameter type_pl filters positions by "All", "Buy", or "Sell". Parameter magicNumber filters by identifier; 0 processes all positions. The function returns the total amount in deposit currency.

Typical uses include real-time monitoring, strategy performance checks, and tighter risk control. In automated systems, it can support risk modules, reporting, and rule-based closing conditions.

πŸ‘‰ Read | AlgoBook | @mql5dev

#MQL5 #MT5 #EA
❀28πŸ‘Œ3πŸ‘2
This series builds a retail-friendly statistical arbitrage workflow in MT5, starting with correlation, cointegration, and stationarity testing (Engle-Granger/Johansen, ADF, KPSS) using Python libraries to keep the focus on practical interpretation.

It then moves into production concerns: storing market data in MT5’s built-in SQLite via an MQL5 Service, plus screening/scoring baskets by objective metrics like cointegration strength, weight stability, and mean-reversion half-life.

For live monitoring, it applies RWEC, IS/OOS ADF, Chow, and CUSUM to detect drift, rebalance needs, and structural breaks.

The key upgrade is architectural: keep SQLite for trade-state and transactions (OLTP), but offload heavy historical analytics (OLAP) to DuckDBβ€”an embedded, zero-admin engine that scales on a laptop and integrates cleanly with SQLite, Pandas/Arrow, and CS...

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀31πŸ‘Œ3
This article upgrades a swing-point trendline breakout concept into a full parallel-channel scanner that tracks both rails, so upside and downside breakouts are treated symmetrically instead of being missed on the β€œunwatched” side.

Channels are built from structurally meaningful swing highs/lows, filtered with ATR to ignore noise. The upper rail is defined by consecutive swing highs, and the lower rail is a true parallel projection to preserve slope consistency. The channel recalculates on completed bars to stay aligned with live structure without unstable repaint behavior.

Breakouts require a candle close beyond a boundary plus optional volatility/threshold checks, with an optional retest state machine (neutral β†’ pending β†’ confirmed β†’ expired). Confirmed signals are stored and plotted as non-repainting markers, separated from adaptive channel redraws fo...

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀42✍1πŸ‘Œ1🀝1
Part 21 upgrades an MQL5 canvas regression/correlation tool into a dual-theme visualizer, adding a cyberpunk mode aimed at improving readability during long sessions and night trading. The classic layout stays available, with a header button to switch themes without duplicating rendering logic.

The implementation centers on theme state, a glowIntensity input, a color palette, and an animation frame counter. A BlendColors utility enables smooth gradients and glow transitions, while timer-driven redraws power pulsing borders, twinkling stars, and animated grids.

Rendering is decomposed into focused functions: starfield background, holographic border with sine-based phase, gradient header with text glow, neon points, anti-aliased regression line centering, glass-morphism stats/legend panels, and neon resize indicators. The result is a more interactiv...

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀46⚑8πŸ‘3✍1
Modify_Orders.mqh targets automated management of positions and pending orders in MetaTrader 5 EAs and indicators. The file provides two functions focused on routine modification of Stop Loss, Take Profit, and pending order prices, with configurable value calculation in pips or absolute prices.

Modify_Position() updates SL/TP for open positions using filtering by symbol and Magic Number, plus selectable modes such as All, Buy, Sell, and profitability-based subsets. Positions are scanned in reverse order, checked for type and profit state, then new levels are calculated either by Price mode (direct assignment) or Value mode (Price Β± Value Γ— Point) and sent via OrderSend().

Modify_Order() updates pending Stop/Limit orders with filtering by symbol, Magic Number, and order type string cross-checked against the actual system type. The logic preserves unchanged ...

πŸ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #EA
❀36πŸ‘Œ2
DoEasy’s graphics layer is refactored around a new β€œgraphical element” concept: a lightweight base canvas object that matches the library’s object model better than the previously started form class. The goal is a clean hierarchy (base object β†’ canvas element β†’ form/window composites) that makes objects easier to find, sort, and manage during rendering.

Core changes include rebuilding the common GBaseObj to store shared metadata (type, chart/subwindow, prefixed naming, Y-shift), then adding CGCnvElement backed by CCanvas. The element implements property storage, comparisons for sorting, hit-testing for bounds vs active area, creation via bitmap label, move/resize, and opacity control.

Select.mqh is extended to sort/search these elements. A test EA creates multiple elements and handles click events by cycling transparency, demonstrating event-driven int...

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #Indicator
❀60✍3πŸ‘Œ3⚑2
VR Breakdown Level outlines an automated breakout approach based on prior period extremes. The lookback period used to compute reference levels is user-defined in the robot settings.

At the start of each new period, the robot records the previous period’s High and Low. When price reaches the prior High, a buy is opened; when price reaches the prior Low, a sell is opened. Trade volume is set via inputs.

Each position is immediately protected with user-defined Stop Loss and Take Profit. Exits occur only via SL or TP, with no additional closing rules.

The same logic can be implemented using pending BUY STOP and SELL STOP orders, with the added requirement to cancel the opposite order after entry. Market-entry logic based on internally tracked levels avoids publishing intended entry prices to the broker in advance.

πŸ‘‰ Read | VPS | @mql5dev

#MQL4 #MT4 #EA
❀33✍2πŸ‘Œ2