System logic uses two internal Renko streams built from BID ticks. A slow stream defines direction, while a fast stream provides the entry trigger. Both apply classic two-brick reversal rules, and entries are permitted only when fast and slow directions match.
Exits are handled by a small target, stop, opposite fast Renko reversal, or a maximum holding time. After closing, a short cooldown in Renko bricks blocks immediate re-entry. Only one position per symbol is allowed, and a spread filter blocks entries when spread is large relative to the fast brick.
Default inputs: Fast 21, Slow 39, Entry Run 1, TP 1.4 fast bricks, SL 2.1, Max Hold 200 minutes, Cooldown 3, Max Spread Fraction 0.57, Lots 0.01.
Example tester run (XAUUSD, M1 host, real ticks, 2026-05-01 to 2026-08-24): 79 trades, +589.34 USD, PF 2.27, max DD 1.18%, win rate 64.56%. Historical demonstrat...
π Read | AlgoBook | @mql5dev
Exits are handled by a small target, stop, opposite fast Renko reversal, or a maximum holding time. After closing, a short cooldown in Renko bricks blocks immediate re-entry. Only one position per symbol is allowed, and a spread filter blocks entries when spread is large relative to the fast brick.
Default inputs: Fast 21, Slow 39, Entry Run 1, TP 1.4 fast bricks, SL 2.1, Max Hold 200 minutes, Cooldown 3, Max Spread Fraction 0.57, Lots 0.01.
Example tester run (XAUUSD, M1 host, real ticks, 2026-05-01 to 2026-08-24): 79 trades, +589.34 USD, PF 2.27, max DD 1.18%, win rate 64.56%. Historical demonstrat...
π Read | AlgoBook | @mql5dev
β€19π9π₯2π¨βπ»2β‘1π1
An EA implementation that constructs fixed-size Renko bricks directly from BID ticks, using classic two-brick reversal confirmation. A confirmed DOWN->UP reversal defines a support zone; a confirmed UP->DOWN reversal defines a resistance zone.
Entries require displacement: price must move away from the new zone before any retest qualifies. On a return to the zone, a completed Renko brick confirming rejection triggers an order. Each zone is tradable once, with a single active position per symbol. Exits occur via TP, SL, opposite reversal, or maximum holding time. A spread filter blocks trades when spread is large relative to brick size. No DLLs, external libraries, custom indicators, custom symbols, or offline Renko charts; the chart timeframe is only a host.
Defaults: Brick 18.0; Zone half width 1.65; Move away 0.90; Max age 53 bricks; TP 5.50; SL 2.90; Hold 6...
π Read | Forum | @mql5dev
Entries require displacement: price must move away from the new zone before any retest qualifies. On a return to the zone, a completed Renko brick confirming rejection triggers an order. Each zone is tradable once, with a single active position per symbol. Exits occur via TP, SL, opposite reversal, or maximum holding time. A spread filter blocks trades when spread is large relative to brick size. No DLLs, external libraries, custom indicators, custom symbols, or offline Renko charts; the chart timeframe is only a host.
Defaults: Brick 18.0; Zone half width 1.65; Move away 0.90; Max age 53 bricks; TP 5.50; SL 2.90; Hold 6...
π Read | Forum | @mql5dev
β€23π10π₯2π¨βπ»2β1π€1π1
This article connects sorting/searching basics to core data structures that make trading code faster and easier to reason about in MQL5: queues, as a foundation for later lists and trees.
It first builds a FIFO queue using a dynamic array with two operations: append at the end and restore from index 0. Removing index 0 triggers a shift, preserving insertion order and providing a clear βemptyβ return value.
It then upgrades to a circular queue (ring buffer) with fixed capacity, using read/write indices that wrap around. New data overwrites the oldest when full, avoiding costly shiftsβideal for sliding-window indicators like moving averages and other stream-processing tasks in MetaTrader 5.
π Read | AlgoBook | @mql5dev
It first builds a FIFO queue using a dynamic array with two operations: append at the end and restore from index 0. Removing index 0 triggers a shift, preserving insertion order and providing a clear βemptyβ return value.
It then upgrades to a circular queue (ring buffer) with fixed capacity, using read/write indices that wrap around. New data overwrites the oldest when full, avoiding costly shiftsβideal for sliding-window indicators like moving averages and other stream-processing tasks in MetaTrader 5.
π Read | AlgoBook | @mql5dev
β€18π9π₯4β‘3π€©3
This article tackles a practical UI gap in MT5 replay/simulation: restoring deleted Stop Loss and Take Profit directly from the chart, without relying on terminal dialogs.
The approach uses a draggable price line and derives the intended SL/TP from context (position side and relative level), while snapping to the symbolβs tick size by reusing the existing mouse indicatorβs normalized price.
On the EA side, two new events are added and routed through a single SL/TP modifier. A key detail is passing negative values to mean βkeep the current server-side valueβ, forcing a fresh PositionSelectByTicket and preventing accidental deletion of the other leg.
On the indicator side, interaction is rebuilt around C_Mouse instead of C_Terminal, with explicit hitboxes (e.g., close button) to make chart-only control deterministic for traders and developers.
π Read | NeuroBook | @mql5dev
The approach uses a draggable price line and derives the intended SL/TP from context (position side and relative level), while snapping to the symbolβs tick size by reusing the existing mouse indicatorβs normalized price.
On the EA side, two new events are added and routed through a single SL/TP modifier. A key detail is passing negative values to mean βkeep the current server-side valueβ, forcing a fresh PositionSelectByTicket and preventing accidental deletion of the other leg.
On the indicator side, interaction is rebuilt around C_Mouse instead of C_Terminal, with explicit hitboxes (e.g., close button) to make chart-only control deterministic for traders and developers.
π Read | NeuroBook | @mql5dev
β€16π9π₯4π1π1π1
MetaTrader 5βs History Navigator is extended from one-off date/time jumps into a persistent βhistorical bookmarksβ system for repeatable chart research.
Each bookmark captures symbol, timeframe, timestamp (not bar index), plus a user-defined name and optional notes, so the original chart context can be reconstructed reliably even as history loads or shifts.
Persistence is handled by a dedicated CBookmarkStorage layer that serializes records to a small CSV file, validates input on load, and keeps UI logic out of file I/O. Updates are written immediately, with rollback on save failure to prevent memory/file divergence.
The existing NavigateToDateTime() engine is reused for both manual date navigation and bookmark recall, avoiding duplicated bar-search and chart-positioning logic while adding create/select/go-to/delete workflows in the dialog.
π Read | CodeBase | @mql5dev
Each bookmark captures symbol, timeframe, timestamp (not bar index), plus a user-defined name and optional notes, so the original chart context can be reconstructed reliably even as history loads or shifts.
Persistence is handled by a dedicated CBookmarkStorage layer that serializes records to a small CSV file, validates input on load, and keeps UI logic out of file I/O. Updates are written immediately, with rollback on save failure to prevent memory/file divergence.
The existing NavigateToDateTime() engine is reused for both manual date navigation and bookmark recall, avoiding duplicated bar-search and chart-positioning logic while adding create/select/go-to/delete workflows in the dialog.
π Read | CodeBase | @mql5dev
β€20π4π€©3π3π2
MT5 Strategy Tester covers automated backtests, but manual price-action review still lacks an interactive bar-by-bar replay mode. A replay tool can hide future candles, reveal one bar at a time, and allow decision-making without hindsight bias.
A practical MQL5 design uses DRAW_COLOR_CANDLES with buffers initialized to EMPTY_VALUE, then progressively filled to reveal candles. Controls include an ON/OFF toggle, a draggable vertical anchor for the start point, Play/Pause, and Buy/Sell for a single paper trade with Entry/SL/TP lines.
Core logic combines OnChartEvent() for UI and drag handling with OnTimer() for timed playback, viewport tracking, price line updates, and TP/SL monitoring. Deactivation restores original chart properties and removes all replay objects.
π Read | VPS | @mql5dev
A practical MQL5 design uses DRAW_COLOR_CANDLES with buffers initialized to EMPTY_VALUE, then progressively filled to reveal candles. Controls include an ON/OFF toggle, a draggable vertical anchor for the start point, Play/Pause, and Buy/Sell for a single paper trade with Entry/SL/TP lines.
Core logic combines OnChartEvent() for UI and drag handling with OnTimer() for timed playback, viewport tracking, price line updates, and TP/SL monitoring. Deactivation restores original chart properties and removes all replay objects.
π Read | VPS | @mql5dev
β€19π6π₯2π2
Part II extends queues into LIFO behavior by converting a FIFO implementation into a stack with minimal changes: only the read/remove point is adjusted, while insertion order stays intact.
It also notes that stacks mirror how CPUs manage call frames, which makes the data structure relevant beyond textbook exercises.
The text then moves from arrays to lists in MQL5. Because pointers to structures are restricted, classes are used to model nodes, enabling a singly linked list that behaves like a stack without relying on arrays.
Key takeaway: internal implementation can vary, but a stable interface determines usability and outcomes.
π Read | Signals | @mql5dev
It also notes that stacks mirror how CPUs manage call frames, which makes the data structure relevant beyond textbook exercises.
The text then moves from arrays to lists in MQL5. Because pointers to structures are restricted, classes are used to model nodes, enabling a singly linked list that behaves like a stack without relying on arrays.
Key takeaway: internal implementation can vary, but a stable interface determines usability and outcomes.
π Read | Signals | @mql5dev
β€11π9π€©1π1
MetaTrader 5 ZOrder cannot be overridden in a reliable way, so the focus shifts to using the platform event sequence to identify the real click target.
A minimal indicator shows the pattern: CHARTEVENT_MOUSE_MOVE is emitted before CHARTEVENT_OBJECT_CLICK. With overlapping objects, this order remains consistent and can be used to gate interaction.
Code updates consolidate priorities: keep default 0 and add ePriorityNull for non-interactive objects. This requires recompilation and small fixes in classes such as C_ChartFloatingRAD.
Input handling is adjusted by adding a state flag in C_Terminal and checking validity on MOUSE_MOVE, then accepting OBJECT_CLICK only when the click is marked valid and the object name matches. This avoids foreground checks and reduces dependency on manual ZOrder management.
Next step prepares multi-position and pending-ord...
π Read | Quotes | @mql5dev
A minimal indicator shows the pattern: CHARTEVENT_MOUSE_MOVE is emitted before CHARTEVENT_OBJECT_CLICK. With overlapping objects, this order remains consistent and can be used to gate interaction.
Code updates consolidate priorities: keep default 0 and add ePriorityNull for non-interactive objects. This requires recompilation and small fixes in classes such as C_ChartFloatingRAD.
Input handling is adjusted by adding a state flag in C_Terminal and checking validity on MOUSE_MOVE, then accepting OBJECT_CLICK only when the click is marked valid and the object name matches. This avoids foreground checks and reduces dependency on manual ZOrder management.
Next step prepares multi-position and pending-ord...
π Read | Quotes | @mql5dev
β€11π9π₯3π€©1π1
Prop-firm sizing is a constrained optimization problem: the trade size must reflect both signal strength and the remaining daily/overall drawdown budget. Because these limits are path-dependent and sometimes expand with locked-in profit, static fractional or Kelly-based sizing cannot react correctly without live account state.
The refactor takes a previously firm-specific PropFirmAwareSizer and separates program terms from sizing math. A frozen PropFirmRuleSet captures variable rules (phase targets, fixed vs dynamic daily cap, news profit-credit haircut, drawdown basis, overnight policy). PropFirmAccountState becomes stateful and rule-driven, while pure functions stay unit-testable.
Key technical gain: correct handling of equity- vs balance-based drawdown checks, and explicit branching for dynamic daily limits. Validation compares the new implement...
π Read | Quotes | @mql5dev
The refactor takes a previously firm-specific PropFirmAwareSizer and separates program terms from sizing math. A frozen PropFirmRuleSet captures variable rules (phase targets, fixed vs dynamic daily cap, news profit-credit haircut, drawdown basis, overnight policy). PropFirmAccountState becomes stateful and rule-driven, while pure functions stay unit-testable.
Key technical gain: correct handling of equity- vs balance-based drawdown checks, and explicit branching for dynamic daily limits. Validation compares the new implement...
π Read | Quotes | @mql5dev
β€14π10π€©2π2π₯1π1π¨βπ»1
A trade management panel defines batch order actions with configurable entry count for BUY and SELL buttons, opening positions based on lot size and selected entries.
Risk and cleanup controls include Close Profit (closes all profitable orders), Close Loss (closes all losing orders), and Close ALL (closes every open order). Set All TP and Set All SL apply a single take-profit or stop-loss value across all active orders.
Operational tools include trailing stop on/off, Buy Pending and Sell Pending using an input price to place limit orders, and Delete Pending to remove all pending orders. Close Above and Close Below close orders based on a user-defined price threshold.
Key parameters cover trailing timer frequency, optional break-even for orders without SL, default trailing behavior, pending-order TP/SL in pips, and a lot size calculator using risk percent a...
π Read | VPS | @mql5dev
Risk and cleanup controls include Close Profit (closes all profitable orders), Close Loss (closes all losing orders), and Close ALL (closes every open order). Set All TP and Set All SL apply a single take-profit or stop-loss value across all active orders.
Operational tools include trailing stop on/off, Buy Pending and Sell Pending using an input price to place limit orders, and Delete Pending to remove all pending orders. Close Above and Close Below close orders based on a user-defined price threshold.
Key parameters cover trailing timer frequency, optional break-even for orders without SL, default trailing behavior, pending-order TP/SL in pips, and a lot size calculator using risk percent a...
π Read | VPS | @mql5dev
β€16π9π₯2π2π€©1
Classic fixed-size Renko is generated internally from BID ticks, using the standard two-brick reversal rule. SuperTrend ATR and band values are computed from completed Renko bricks rather than time-based candles.
Trade entries are permitted only when the latest completed Renko brick direction matches the Renko-based SuperTrend direction. Position exits can be triggered by take-profit, stop-loss, a SuperTrend direction change, or a maximum holding-time limit. An optional short cooldown can be enforced before re-entry.
Risk controls include a strict one-position-per-symbol rule. The EA runs standalone with no external indicator, DLL, custom symbol, or offline chart requirement. A separate visual companion indicator is available at https://www.mql5.com/en/market/product/175340.
This is intended as an educational historical demonstration; default settings are not...
π Read | AppStore | @mql5dev
Trade entries are permitted only when the latest completed Renko brick direction matches the Renko-based SuperTrend direction. Position exits can be triggered by take-profit, stop-loss, a SuperTrend direction change, or a maximum holding-time limit. An optional short cooldown can be enforced before re-entry.
Risk controls include a strict one-position-per-symbol rule. The EA runs standalone with no external indicator, DLL, custom symbol, or offline chart requirement. A separate visual companion indicator is available at https://www.mql5.com/en/market/product/175340.
This is intended as an educational historical demonstration; default settings are not...
π Read | AppStore | @mql5dev
β€15π7π3π―3
Spreads get checked routinely, swaps often get ignored. One overnight hold can exceed the entry spread, and long vs short swap can differ by an order of magnitude depending on the instrument.
A utility script prints swap cost in account currency within seconds. Per open position it shows tonightβs swap for the exact size, plus accumulated swap paid and holding days.
Per symbol (position symbols first, then visible Market Watch) it reports swap per night for 1.0 lot for long and short, the annualized cost using 360-day convention, the implied broker markup per side as (|long|+|short|)/2, and the triple-swap weekday.
Swap modes in points, deposit currency, or interest-rate formats are converted when reliable. Otherwise raw values are shown with currency notes or βn/aβ. Optional inputs include Market Watch scanning, symbol cap, and an on-chart summary.
π Read | AppStore | @mql5dev
A utility script prints swap cost in account currency within seconds. Per open position it shows tonightβs swap for the exact size, plus accumulated swap paid and holding days.
Per symbol (position symbols first, then visible Market Watch) it reports swap per night for 1.0 lot for long and short, the annualized cost using 360-day convention, the implied broker markup per side as (|long|+|short|)/2, and the triple-swap weekday.
Swap modes in points, deposit currency, or interest-rate formats are converted when reliable. Otherwise raw values are shown with currency notes or βn/aβ. Optional inputs include Market Watch scanning, symbol cap, and an on-chart summary.
π Read | AppStore | @mql5dev
β€13π8π€©2π2β‘1
Multi Timeframe Trend Matrix delivers a quick view of trend state from M5 through D1.
Each timeframe is computed from fast and slow EMAs, current price position, and ADX strength. Green tiles indicate price above both EMAs, fast EMA above slow EMA, and ADX at or above the configured threshold. Red tiles require the inverse conditions. Neutral tiles appear when neither full trend rule set is satisfied.
Implementation focuses on efficiency. Indicator handles are created once during initialization and reused. Panel updates run on a timer to keep charts responsive and prevent per-tick handle churn.
Key inputs cover fast/slow EMA periods, ADX period and minimum ADX, optional closed-bar confirmation, plus panel layout, colors, and refresh rate. This is an analysis dashboard only; it does not place trades or forecast results.
π Read | Freelance | @mql5dev
Each timeframe is computed from fast and slow EMAs, current price position, and ADX strength. Green tiles indicate price above both EMAs, fast EMA above slow EMA, and ADX at or above the configured threshold. Red tiles require the inverse conditions. Neutral tiles appear when neither full trend rule set is satisfied.
Implementation focuses on efficiency. Indicator handles are created once during initialization and reused. Panel updates run on a timer to keep charts responsive and prevent per-tick handle churn.
Key inputs cover fast/slow EMA periods, ADX period and minimum ADX, optional closed-bar confirmation, plus panel layout, colors, and refresh rate. This is an analysis dashboard only; it does not place trades or forecast results.
π Read | Freelance | @mql5dev
β€21π9π€©2π¨βπ»2π1
Market Structure Swing Map is a chart analysis tool designed to show price structure with minimal on-screen noise. It marks confirmed swing highs and swing lows, then classifies each new point versus the prior point of the same type as HH, HL, LH, or LL.
All calculations are based on closed candles. A swing is printed only after the configured number of candles confirms it on both sides, keeping past markings stable and avoiding forward-looking signals. An optional structure line can connect confirmed points to improve readability of the sequence.
Key settings include Swing Strength (confirmation candles per side), Maximum Bars (history scanned), optional swing price display, optional structure line, and alerts for newly confirmed structure points. The tool does not place, modify, or close trades.
π Read | AlgoBook | @mql5dev
All calculations are based on closed candles. A swing is printed only after the configured number of candles confirms it on both sides, keeping past markings stable and avoiding forward-looking signals. An optional structure line can connect confirmed points to improve readability of the sequence.
Key settings include Swing Strength (confirmation candles per side), Maximum Bars (history scanned), optional swing price display, optional structure line, and alerts for newly confirmed structure points. The tool does not place, modify, or close trades.
π Read | AlgoBook | @mql5dev
β€33π9π€©2π2π₯1π1
Session Liquidity Map visualizes intraday structure by drawing separate boxes for the Asia, London, and New York sessions, then marking the high and low formed within each defined window. Session times are configured in broker/server time to avoid implicit timezone conversions.
Each session range can print its size in points. High and low levels can be extended beyond the session close for follow-up liquidity reference. Historical boxes are supported, and the active session updates on every new candle.
Key inputs include start/end times per session, Lookback Days for history depth, Show Range Text for point display, and Extend High Low plus extension length. Daylight saving and local time are not adjusted automatically, so session windows should be aligned to the trading server clock.
π Read | AlgoBook | @mql5dev
Each session range can print its size in points. High and low levels can be extended beyond the session close for follow-up liquidity reference. Historical boxes are supported, and the active session updates on every new candle.
Key inputs include start/end times per session, Lookback Days for history depth, Show Range Text for point display, and Extend High Low plus extension length. Daylight saving and local time are not adjusted automatically, so session windows should be aligned to the trading server clock.
π Read | AlgoBook | @mql5dev
β€27π₯5π4π€©2π¨βπ»2
Fair Value Gap Scanner identifies three-candle price imbalances and renders bullish and bearish gaps as chart zones based on completed candles only.
Zones can persist after mitigation or be removed automatically. Mitigation logic can be set to either first touch of the zone or full fill, depending on the trading plan. A minimum gap size filter helps exclude minor imbalances on noisier instruments.
The scanner processes new candles rather than recreating objects on every tick, keeping chart load stable while retaining historical context.
Key inputs include Maximum Bars (scan depth), Minimum Gap Points, per-direction visibility toggles, Hide Mitigated, Use Full Fill, Extension Bars for zone length, and optional alerts triggered after candle confirmation. This is a visual analysis indicator and does not execute trades.
π Read | VPS | @mql5dev
Zones can persist after mitigation or be removed automatically. Mitigation logic can be set to either first touch of the zone or full fill, depending on the trading plan. A minimum gap size filter helps exclude minor imbalances on noisier instruments.
The scanner processes new candles rather than recreating objects on every tick, keeping chart load stable while retaining historical context.
Key inputs include Maximum Bars (scan depth), Minimum Gap Points, per-direction visibility toggles, Hide Mitigated, Use Full Fill, Extension Bars for zone length, and optional alerts triggered after candle confirmation. This is a visual analysis indicator and does not execute trades.
π Read | VPS | @mql5dev
β€12π6β4π€©3π€1π1
SwiftDraw Starter shows a practical pattern for MT5 chart utilities: hotkey-driven object creation with a minimal indicator footprint (no buffers, no plots) and all interaction routed through OnChartEvent.
Hotkeys are mapped via StringGetCharacter to key codes, then used to arm one βpendingβ mode at a time (H/V lines, trendline, rectangle, Fibonacci, buy/sell arrows). ESC clears state and restores chart mouse scrolling to avoid input conflicts during drawing.
A compact i18n layer is implemented with enums and a Tr() switch, keeping UI prompts consistent across languages. The on-chart legend is rendered using OBJ_RECTANGLE_LABEL and OBJ_LABEL with a prefix for bulk cleanup, enabling a clean show/hide toggle without leaving orphaned objects.
Object creation follows a predictable naming scheme and sets selection/visibility flags for immediate editing after pl...
π Read | Signals | @mql5dev
Hotkeys are mapped via StringGetCharacter to key codes, then used to arm one βpendingβ mode at a time (H/V lines, trendline, rectangle, Fibonacci, buy/sell arrows). ESC clears state and restores chart mouse scrolling to avoid input conflicts during drawing.
A compact i18n layer is implemented with enums and a Tr() switch, keeping UI prompts consistent across languages. The on-chart legend is rendered using OBJ_RECTANGLE_LABEL and OBJ_LABEL with a prefix for bulk cleanup, enabling a clean show/hide toggle without leaving orphaned objects.
Object creation follows a predictable naming scheme and sets selection/visibility flags for immediate editing after pl...
π Read | Signals | @mql5dev
β€8π6
IronHawk SMC Trade Zones M5 is an M5 chart indicator that flags structured setups only on closed candles with non-repainting logic. It aggregates confirmed swing points, liquidity sweeps, BOS/CHoCH, displacement, Fair Value Gaps, Order Blocks, plus RSI, MACD and ATR-based risk metrics. No orders are sent or managed; Entry, Stop Loss, TP1 and TP2 are shown as proposed levels for manual validation.
Setup flow includes ARMED, ACTIVE, TP, SL, EXPIRED, INVALIDATED and AMBIGUOUS states, with up to five completed setups listed and color-coded outcomes. A clickable history jumps to the originating signal candle. Alerts and optional CSV journaling are available.
A retail-frequency mode prioritizes organic SMC. If fewer than two opportunities appear in a broker day, scheduled fallback signals after 09:00 and 14:00 server time can be generated via a closed-bar ...
π Read | Forum | @mql5dev
Setup flow includes ARMED, ACTIVE, TP, SL, EXPIRED, INVALIDATED and AMBIGUOUS states, with up to five completed setups listed and color-coded outcomes. A clickable history jumps to the originating signal candle. Alerts and optional CSV journaling are available.
A retail-frequency mode prioritizes organic SMC. If fewer than two opportunities appear in a broker day, scheduled fallback signals after 09:00 and 14:00 server time can be generated via a closed-bar ...
π Read | Forum | @mql5dev
β€13π3